Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'route-http-client-security'

  • Loading branch information...
commit 49cb53d7352fa4c991d5a29388ba42824d31f83b 2 parents c6a2674 + 54f1a51
@tj tj authored
Showing with 4 additions and 1 deletion.
  1. +1 −0  lib/express/core.js
  2. +3 −1 lib/express/dsl.js
View
1  lib/express/core.js
@@ -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
4 lib/express/dsl.js
@@ -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")
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.