Last active
December 17, 2015 19:49
-
-
Save mihs/5663080 to your computer and use it in GitHub Desktop.
Working around implicit router in express 3.x ( https://github.com/visionmedia/express/issues/1404 ). Do this after you have loaded your middleware and set up your routes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# router was automatically added, remove it and add it again at the end | |
for index, middleware of app.stack | |
if middleware.handle == app.router | |
routerAt = index | |
break | |
if routerAt | |
app.stack.splice(routerAt, 1) | |
app.use(app.router) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment