I have multiple Node applications (build on Express framework).
Now I have placed them like this -
/var/www/app1
/var/www/app2
/var/www/app3
Now I want to run these 3 apps on the same port (say 8080). Is that possible ?
One thing to note is that, Each app has common routes like these -
app.get('/', func...);
app.get('/about', func...);
app.post('/foo', func...);
app.post('/bar', func...);
Basically I want to do it like you can do with Apache/PHP setup.
So with a LAMP stack when you have -
/var/www/app1
/var/www/app2
/var/www/app3
You can easily access them as different apps from -
localhost/app1
localhost/app2
localhost/app3
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…