Skip to content

Instantly share code, notes, and snippets.

@olegpolyakov
Created March 16, 2017 21:30
Show Gist options
  • Save olegpolyakov/ab84f6c5a9700e6669955e16b24c3c05 to your computer and use it in GitHub Desktop.
Save olegpolyakov/ab84f6c5a9700e6669955e16b24c3c05 to your computer and use it in GitHub Desktop.
Node app using vhost
'use strict';
const express = require('express');
const vhost = require('vhost');
const site = require('./site');
const app = require('./app');
const api = require('./api');
const admin = require('./admin');
const main = express();
main.use(vhost('codedojo.ru', site));
main.use(vhost('app.codedojo.ru', app));
main.use(vhost('api.codedojo.ru', api));
main.use(vhost('admin.codedojo.ru', admin));
main.listen(port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment