var express = require('express'), app = express();
var port = process.env.PORT || 3000;
app.use(function(req,res,next){ if (req.hostname == "domain1") { app.get('/', function(req,res){ res.send('Domain1 is active'); }) else if (req.hostname == "domain2") { app.get('/', function(req,res){ res.send('Doamin2 is active'); }); } next(); } });
app.listen(port);
--
You received this message because you are subscribed to the Google Groups "Express" group.
To unsubscribe from this group and stop receiving emails from it, send an email to express-js+...@googlegroups.com.
To post to this group, send email to expre...@googlegroups.com.
Visit this group at http://groups.google.com/group/express-js.
For more options, visit https://groups.google.com/d/optout.