Skip to content

Instantly share code, notes, and snippets.

@mikermcneil
Last active August 29, 2015 14:04
Show Gist options
  • Save mikermcneil/dbe0bed18675c294da84 to your computer and use it in GitHub Desktop.
Save mikermcneil/dbe0bed18675c294da84 to your computer and use it in GitHub Desktop.
THIS ONE IS OLD, DO NOT USE (just keeping here for posterity)

ACTUALLY use this instead:

============================================================

HTTP/TCP Web Framework Components

See the more recent gist instead.

The goals of this file are archaelogical, not architectural (in other words, I'm not trying to suggest anything in particular, just taking inventory of what we have.)

Field Survey

This inventory of modules was compiled from the following transects:

jshttp-* / middleware
tidbits from sails core and the request interpreter

see https://gist.github.com/mikermcneil/2ed1cb5d47a4e937a059 for background

sails-hook-*

Transects

Here are the various modules, split up by category.

TCP Socket Mixins (req.socket.*)

Modules that add a single method or property to the TCP socket prototype.

Module Description
etc ...

Request Mixins (req.*)

Modules that DO NOTHING EXCEPT add a single method or property to the request prototype.

Module Property Description
expressjs/session req.session Simple session middleware https://github.com/expressjs/session
etc req._______

Response Mixins (res.*)

Modules that DO NOTHING EXCEPT add a single method or property to the response prototype.

Module Property Description
etc res._______

Utilities

These modules are req/res/tcpsock utilities that provide some relevant functionality, but may or may not actually modify the req and res objects.

Module Description
expressjs/finished Execute a canonical Node callback when a request closes, finishes, or errors. https://github.com/expressjs/finished

Middleware (function (res, res, next) { ... })

Modules which export a configurator function which returns a single middleware. Some of these modules also expose new or modified properties on the req/res objects. See the req.* and req.* columns.

Module req.* res.* Description
expressjs/session req.session Simple session middleware https://github.com/expressjs/session
expressjs/timeout Make the request time out after xmsif response hasn't been sent https://github.com/expressjs/timeout

Misc.

Modules that didn't fit any other category closely enough, or were hard to categorize because they wear so many hats.

Module Description
senchalabs/connect TODO
visionmedia/express.../lib/response.js Adds res.send, res.json, res.render, and others. https://github.com/strongloop/express/blob/master/lib/response.js
etc ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment