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로 변경하려면 하위 응용 프로그램에서도 경로를 변경해야합니다.
모든 하위 응용 프로그램에 대해이 투명성/상대적을 정의하는 방법이 있습니까?