Node.js Express Subdomain Middleware.
I thought that this was a pretty sweet project express-subdomain-handler but I wanted it crafted a bit differently for my purposes and the ability to force HTTPS and removal of the unneccessary 'www' prefix. Thanks for the inspiration @WilsonPage
/etc/hosts
127.0.0.1 localhost127.0.0.1 blog.localhost127.0.0.1 writing.localhost
server
/** * * @example basic * * @description limited example * $ npm install express * */ var app express = subdomain = ; app = ; app; app; app; app; app;
available options
base
- Required, the base domain name i.e. 'localhost'removeWWW
- Defaults tofalse
ignoreWWW
- Defaults tofalse
prefix
- Defaults to 'subdomain'debug
- Defaults tofalse