Skip to content
Myr

Added onRouteAdded 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 7b9f119 · Browse files · 1 file+4 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+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:lib/express.core.js+4 added-2 removed
647 unmodified lines
648 routeFunctionFor : function(method) {649 return function(path, options, callback) {650 if (options.constructor == Function) callback = options, options = {}651 path = Express.pathToRegexp(Express.normalizePath(path))652 Express.routes.push({652 var route = {653 keys : Express.regexpKeys,654 path : path,655 method : method,656 options : options,657 callback : callback658 })658 }659 Express.hook('onRouteAdded', route)660 Express.routes.push(route)661 }662 }663 }664
31 unmodified lines