Skip to content
Myr

Added options for routes

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

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

  • other:+4 added−3 removed

1 file+4 added−3 removed

modified:lib/express.core.js+4 added-3 removed
319 unmodified lines
320 * @api private321 */322 323 routeFunctionFor : function(method) {324 return function(path, callback) {324 return function(path, options, callback) {325 if (options.constructor == Function) callback = options, options = {}326 path = Express.pathToRegexp(Express.normalizePath(path))327 Express.routes.push({328 keys : Express.regexpKeys,329 path : path,330 method : method,331 options : options,332 callback : callback333 })334 }335 },
16 unmodified lines
352 353})()354355get('user/:name/:operation', function(){354 // ["Accept","application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"],["Accept-Language","en-us"],["Accept-Encoding","gzip, deflate"]356 p(request.headers['User-Agent'])357 p(request.headers['Accept'])358 p(request.headers['Accept-Encoding'])359 p(request.headers['Cookie'])360 return param('operation') + 'ing ' + param('name')361})362362get('articles', function(){363get('articles', { provides : 'text/html' }, function(){364 return 'list of articles'365})366367get(/articles\/(\d+)/, function(){
8 unmodified lines