Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/debitoor/httpsonly

Express middleware that redirects all http requests to https
https://github.com/debitoor/httpsonly

Last synced: 12 days ago
JSON representation

Express middleware that redirects all http requests to https

Awesome Lists containing this project

README

        

# httpsonly

[![https://img.shields.io/npm/v/httpsonly](https://img.shields.io/npm/v/httpsonly)](https://www.npmjs.com/package/httpsonly)
[![Node.js CI](https://github.com/debitoor/httpsonly/actions/workflows/node.js.yml/badge.svg?branch=master)](https://github.com/debitoor/httpsonly/actions/workflows/node.js.yml)

Express middleware that redirects http requests to https.

Also sets Strict Transport Security header, telling browsers to visit by HTTPS for the next year.
Also hides the powered by express header.

```shell
npm install httpsonly
```

## Usage

```javascript
var httpsonly = require('httpsonly');
app.use(httpsonly()); //app is the express app
```

## License

[MIT](http://opensource.org/licenses/MIT)