1.11.0 • Published 6 years ago

top-vhost v1.11.0

Weekly downloads
55
License
GPL-3.0
Repository
github
Last release
6 years ago

top-vhost

NPM version Linux Status Windows Status Dependency Status Coveralls

Top-Down virtual host for nodejs. Optional, you can set this module like a proxy or a redirect.

Installation

Install through NPM

npm install top-vhost

or

git clone git://github.com/hex7c0/top-vhost.git

API

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,
})).listen(3000);

vhost(options)

options

  • domain - String | RegExp Name or Regex of virtual host (required)
  • dynamic - String Path of dynamic configuration json file (only with Proxies). Array of hosts (default "disabled")
  • static - String Path of static configuration json file. Preserve options (default "disabled")
  • redirect - Array Array of url that will be redirected to this domain (default "disabled")
  • redirectStatus - Number Set type of HTTP header for redirect (permanently 301 or temporary 307) or use another (default "301")
  • insensitive - Boolean Set True if want parse insensitive match (default "sensitive")
  • stripWWW - Boolean Stripe all "www." url (default "disabled")
  • stripOnlyWWW - Boolean Redirect all "www." url to "." url (default "disabled")
  • stripHTTP - Boolean Redirect all "http://" to "https://" url (default "disabled")
  • stripHTTPS - Boolean Redirect all "https://" to "http://" url (default "disabled")
  • framework - Function Functions related to this virtual host (optional)
  • proxies - Object Object for build http proxy, related to http-proxy (optional)

related to https://github.com/nodejitsu/node-http-proxy/blob/master/lib/http-proxy.js#L29-L52

Examples

Take a look at my examples

License GPLv3

1.11.0

6 years ago

1.10.0

7 years ago

1.9.1

8 years ago

1.9.0

8 years ago

1.8.8

8 years ago

1.8.7

8 years ago

1.8.6

8 years ago

1.8.5

9 years ago

1.8.4

9 years ago

1.8.3

9 years ago

1.8.2

9 years ago

1.8.1

9 years ago

1.8.0

9 years ago

1.7.19

9 years ago

1.7.18

9 years ago

1.7.17

9 years ago

1.7.16

9 years ago

1.7.15

9 years ago

1.7.14

9 years ago

1.7.13

9 years ago

1.7.12

9 years ago

1.7.11

10 years ago

1.7.10

10 years ago

1.7.9

10 years ago

1.7.8

10 years ago

1.7.7

10 years ago

1.7.6

10 years ago

1.7.5

10 years ago

1.7.4

10 years ago

1.7.3

10 years ago

1.7.2

10 years ago

1.7.1

10 years ago

1.7.0

10 years ago

1.6.2

10 years ago

1.6.1

10 years ago

1.6.0

10 years ago

1.5.3

10 years ago

1.5.2

10 years ago

1.5.1

10 years ago

1.5.0

10 years ago

1.4.0

10 years ago

1.3.3

10 years ago

1.3.2

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.0.1

10 years ago