Skip to content

Instantly share code, notes, and snippets.

@niklv
Created July 25, 2014 09:06
Show Gist options
  • Save niklv/d9a12d896fe004d87802 to your computer and use it in GitHub Desktop.
Save niklv/d9a12d896fe004d87802 to your computer and use it in GitHub Desktop.
Mount express 3 sub-app to express 4 app.
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