Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webextensions/express-redirect-to-https
Express middleware for redirecting "http" requests to "https" url path
https://github.com/webextensions/express-redirect-to-https
Last synced: 2 months ago
JSON representation
Express middleware for redirecting "http" requests to "https" url path
- Host: GitHub
- URL: https://github.com/webextensions/express-redirect-to-https
- Owner: webextensions
- License: mit
- Created: 2016-12-23T09:31:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-09-25T09:17:40.000Z (over 2 years ago)
- Last Synced: 2024-11-11T21:56:27.671Z (2 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# express-redirect-to-https
Express middleware for redirecting `http` requests to `https` url path.## Usage
```js
var express = require('express');
var redirectToHttps = require('express-redirect-to-https');var app = express();
``````js
app.use(redirectToHttps());// OR
app.use(redirectToHttps({
httpPort: 3000,
httpsPort: 4000
}));// OR
app.use(redirectToHttps({
httpPort: 3000,
httpsPort: 4000,
redirectStatus: 307 // Default redirect status is 301
}));
```