Skip to content
Myr

Setting body and status each request

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

authored by visionmedia · committed by visionmedia · parent 9354884 · Browse files · 1 file+3 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+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:lib/express.core.js+3 added-3 removed
5 unmodified lines
6 7 // --- Response8 9 response : {10 body : null,11 status : 200,10 headers : {},11 cookie : {}12 },13
41 unmodified lines
55 hook : function(name, args) {56 if (this.hookCallbacks[name])57 for (i = 0, len = this.hookCallbacks[name].length; i < len; ++i)58 if (typeof this.hookCallbacks[name][i] == 'function')61 this.hookCallbacks[name][i].apply(this, this.argsArray(arguments, 1))59 this.hookCallbacks[name][i].apply(this, this.argsArray(arguments, 1))60 },61 62 /**63 * Add middlware _callback_ for hook _name_.
15 unmodified lines
79 */80 81 start : function(port) {82 this.server.listen(port || 3000, function(request, response){83 Express.response.body = null84 Express.response.status = 20085 Express.request = request86 request.headers = Express.arrayToHash(request.headers)87 Express.hook('request', request, response)88 request.uri.params = Express.parseNestedParams(request.uri.params)
483 unmodified lines