Package Exports
- top-vhost
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (top-vhost) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
top-down virtual host for expressjs 4. Optional, you can set this module like a proxy or a redirect.
Installation
Install through NPM
npm install top-vhostor
git clone git://github.com/hex7c0/top-vhost.gitAPI
inside expressjs project
var vhost = require('top-vhost');
var father = require('express')();
var child = require('express')();
child.get('/',function(req,res) {
res.send('hello');
});
father.use(vhost({
domain: 'foo.com',
framework: child,
}));
father.listen(3000);vhost(options)
domain- String | RegExp Name or Regex of virtual host (required)redirect- Array Array of url that will be redirected to this domain (default "disabled")framework- Function Functions releated to this virtual host (optional)proxies- Object Object for build http proxy, related tohttp-proxy(optional)
releated to https://github.com/nodejitsu/node-http-proxy/blob/master/lib/http-proxy.js#L34-L51
Examples
Take a look at my examples
License
Copyright (c) 2014 hex7c0
Licensed under the GPLv3 license