Is there an easy way to use completely different routes depending on the host header. Maybe something like this?
const app1 = express('domain1.com');
const app2 = express('domain2.com');
app1.get('*', function(req, res) {
res.status(200).send('connecting to domain1.com');
});
app2.get('*', function(req, res) {
res.status(200).send('connecting to domain2.com');
});
Both the apps listen on the same port but the routes are different for the different domains. Obviously that code doesn't work but is there a good way to go about it?