Skip to content
Myr

Added param() with default value

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

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

  • other:+6 added−2 removed

1 file+6 added−2 removed

modified:lib/express.core.js+6 added-2 removed
127 unmodified lines
128 return value ? this.response.headers[name] = value :129 this.response.headers[name]130 },131 132 param : function(key, defaultValue) {133 return this.request.uri.params[key] || defaultValue134 },135 136 /**137 * Return the contents of a function body.138 *139 * @param {function} body
53 unmodified lines
193 194})()195196get ('/users', function(){197 if (user = param('user')) return 'User: ' + user193 return 'List of users'198 else return 'List of users'199})200201get (/foo(bar)?/, function(){197 dump(captures)202 return 'test'203})204205post ('/users', function(){
4 unmodified lines