Skip to content
Myr

fixed auto use(app.router)

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

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent f961022 · Browse files · 1 file+2 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+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:lib/application.js+2 added-2 removed
123 unmodified lines
124 // router125 this._router = new Router(this);126 this.routes = this._router.routes;127 this.__defineGetter__('router', function(){128 this.__usedRouter = true;128 this._usedRouter = true;129 return self._router.middleware;130 });131132 // default locals
365 unmodified lines
498methods.forEach(function(method){499 app[method] = function(path){500 if ('get' == method && 1 == arguments.length) return this.set(path); 501 var args = [method].concat(toArray(arguments));502 if (!this.__usedRouter) this.use(this._router);502 if (!this._usedRouter) this.use(this.router);503 return this._router._route.apply(this._router, args);504 }505});506
85 unmodified lines