0
Express需要的子应用具有定义的绝对路径。 我不能只用'/'
在otherApp
到app
路由匹配所有的东西给它。我可以为子应用程序使用透明路线吗?
var app = express();
var otherApp = express();
app.get('/', function (req, res) {
res.send('HELLO!');
});
//this works
otherApp.get('/other', function (req, res) {
res.send(req.path);
});
//this doesn't
otherApp.get('/', function (req, res) {
res.send(req.path);
});
app.get('/other*', otherApp);
如果我想改变路线到otherApp,我必须在子应用程序中更改它。
有没有办法来定义所有的子应用这种透明/相对?