1.0.4 ā¢ Published 2 years ago
www-redirect v1.0.4
Redirect 'www' to 'non-www' and 'non-www' to 'www' in NodeJs(Express). (example.com to www.example.com or www.example.com to example.com)
š Homepage
Prerequisites
- npm >=5.5.0
- node >=9.3.0
Install
npm i www-redirect
Usage
const express = require("express");
const redirect = require("www-redirect");
const app = express();
// app.use(redirect(option)); // option = 'www' or option = 'non-www'
// 'www' option for redirecting non-www to www and 'non-www'option for redirecting www to non-www
app.use(redirect("non-www"));
Author
š¤ Shubhadeep
- Websites: https://insload.com | https://deepxnet.com
- Twitter: @shubhaX
- GitHub: @deepx-coder
- LinkedIn: @shubha-deep-halder
š¤ Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page.
Show your support
Give a āļø if this project helped you!
š License
Copyright Ā© 2021 Shubhadeep. This project is MIT licensed.