https://github.com/jutaz/https-rewrite
🌐 Rewrite http links to https
https://github.com/jutaz/https-rewrite
Last synced: 10 months ago
JSON representation
🌐 Rewrite http links to https
- Host: GitHub
- URL: https://github.com/jutaz/https-rewrite
- Owner: jutaz
- Created: 2018-08-23T10:59:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-23T11:24:51.000Z (over 7 years ago)
- Last Synced: 2025-02-24T08:23:43.408Z (10 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# https-rewrite
> Rewrite URLs to https.
[](https://www.npmjs.com/package/https-rewrite) [](https://standardjs.com)
## Install
```bash
npm install --save https-rewrite
```
## Usage
Currently only `express@^4.0.0` is supported as the engine to perform rewrites in.
### `express`
```js
const redirectToHttps = require('https-rewrite/express');
// ... set up express
// Should be one of the topmost (if not the) middlewares.
app.use(redirectToHttps({
// Change the status code used to redirect. Defaults to 307.
status: 301
}))
```
## License
MIT © [jutaz](https://github.com/jutaz)