Created
July 25, 2014 09:06
-
-
Save niklv/d9a12d896fe004d87802 to your computer and use it in GitHub Desktop.
Mount express 3 sub-app to express 4 app.
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
var express = require('express'); | |
var subapp = require('./subapp'); | |
var app = express(); | |
app.use('/subpath/', subapp); | |
//Backward compatibility Express4 to Express3, this is only works for Express3 | |
subapp.route = subapp.mountpath; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment