Skip to content

Instantly share code, notes, and snippets.

@outsideris
Last active June 22, 2022 21:26
Show Gist options
  • Save outsideris/750032 to your computer and use it in GitHub Desktop.
Save outsideris/750032 to your computer and use it in GitHub Desktop.
express vhost example
var express = require('express'),
site1 = express.createServer(),
site2 = express.createServer(),
site_vhosts = [],
vhost;
site_vhosts.push(express.vhost('domain1.com', site1));
site_vhosts.push(express.vhost('domain2.com', site2));
vhost = express.createServer.apply(this, site_vhosts);
site1.listen(8080);
site2.listen(9090);
vhost.listen(80);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment