Subdomains for Express
Easily manage and delegate routes to subdomains.
Usage
Example express boilerplate:
const express = const subdomain = const app =
Basic usage
app // Visit: foo.example.com// Hello there
Use wildcard (*
)
app // Visit: foo.example.com// Hello pretty // Visit: bar.foo.example.com// Hello pretty
Caveat
If your domain is ending at a second level TLD like .co.in
, then use app.set('subdomain offset', 3)
before using subdomain.
Refer Express docs for more information.
Licensing
Licensed under MIT License.