Force an express app to use a particular domain by 301 redirecting none matching requests.
npm install --save express-set-domain
Add to your express application before all other routes.
var express = ;var app = ;var setDomain = ;// add middleware to force requests to orcascan.comapp;// typical routeapp;
Based on the above example, a request to:
would be 301 redirected to:
without having to list every potential incoming domain name.
Feel free to contribute, either by raising an issue or:
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
Star the repo
If you find this useful please star the repo, it helps us prioritize which open source bugs to fix 🙌
For change-log, check releases.