Route name

This commit is contained in:
斟酌 鵬兄 2015-02-11 18:23:38 +08:00
parent ab25b7648d
commit 24ddf7a4b8

View File

@ -40,10 +40,11 @@ var Router = function( http )
util.inherits( Router, events.EventEmitter ); util.inherits( Router, events.EventEmitter );
Router.prototype.addRoute = function( name, _route, _action, _status ) Router.prototype.addRoute = function( _name, _route, _action, _status )
{ {
this.routes[ name ] = { this.routes[ _name ] = {
route: _route name: _name
, route: _route
, action: String( _action ) , action: String( _action )
, status: Boolean( , status: Boolean(
typeof _status !== 'undefined' ? _status : true typeof _status !== 'undefined' ? _status : true