Skip to content
Myr

Moving middleware to request hook

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent fa5223e · Browse files · 1 file+8 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−3 removed

  • other:+8 added−3 removed

1 file+8 added−3 removed

modified:lib/express.core.js+8 added-3 removed
25 unmodified lines
26 }27 }28 },29 30 hookCallbacks : {},30 hookCallbacks : {31 request : [32 function (request, response) {33 Express.request = request34 request.headers = Express.arrayToHash(request.headers)35 }36 ]37 },38 39 hook : function(name) {40 for (var name in this.hookCallbacks)41 if (this.hookCallbacks.hasOwnProperty(name))
9 unmodified lines
51 */52 53 start : function(port) {54 this.server.listen(port || 3000, function(request, response){48 Express.request = request55 Express.hook('request', request, response)50 request.headers = Express.arrayToHash(request.headers)56 request.cookie = Express.parseCookie(request.headers['Cookie'])57 request.uri.params = Express.parseNestedParams(request.uri.params)58 request.uri.path = Express.normalizePath(request.uri.path)59 Express.response.cookie = request.cookie
454 unmodified lines