Permalink
Browse files

Merge branch 'route-http-client-security'

  • Loading branch information...
2 parents c6a2674 + 54f1a51 commit 49cb53d7352fa4c991d5a29388ba42824d31f83b @tj tj committed Feb 12, 2010
Showing with 4 additions and 1 deletion.
  1. +1 −0 lib/express/core.js
  2. +3 −1 lib/express/dsl.js
View
@@ -201,6 +201,7 @@ Server = Class({
run: function(port, host, backlog){
var self = this
+ this.running = true
if (host !== undefined) this.host = host
if (port !== undefined) this.port = port
if (backlog !== undefined) this.backlog = backlog
View
@@ -21,8 +21,10 @@ function route(method) {
fn = options, options = {}
if (path.indexOf('http://') === 0)
return http[method].apply(this, arguments)
- else
+ else if (!Express.server.running)
Express.routes.push(new Route(method, path, fn, options))
+ else
+ throw new Error('cannot create route ' + method.toUpperCase() + " `" + path + "' at runtime")
}
}

0 comments on commit 49cb53d

Please sign in to comment.