# expressjs-force-https

> A simple express.js middleware that redirects incoming unencrypted HTTP requests to HTTPS.

Latest version **2.0.0** (published 2017-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install expressjs-force-https
pnpm add expressjs-force-https
yarn add expressjs-force-https
bun add expressjs-force-https
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-10-30 |
| First published | 2017-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Kwabena Berko |
| Maintainers | kwabenaberko |
| Keywords | https, http, ssl, secure, nodejs, expressjs, middlewares |

## Links

- npm: https://www.npmjs.com/package/expressjs-force-https
- Repository: https://github.com/KwabenBerko/expressjs-force-https
- Homepage: https://github.com/KwabenBerko/expressjs-force-https#readme
- Issues: https://github.com/KwabenBerko/expressjs-force-https/issues
- npm.io page: https://npm.io/package/expressjs-force-https

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2017-10-30
- 1.0.0 — 2017-10-17

## README

# expressjs-force-https
A simple express.js middleware that redirects incoming unencrypted HTTP requests to HTTPS.

## Installation

``` javascript
npm install expressjs-force-https
```

## Usage

``` javascript
const express = require("express");
const forceHTTPS = require("expressjs-force-https").forceHTTPS;
const app = express();

//Redirecting incoming unencrypted http requests
app.use(forceHTTPS);

app.listen(3000, () => {
    console.log(`Server Running...`);
});
```

### To force HTTPS on a Node App Service on Azure:
``` javascript
const forceAzureHTTPS = require("expressjs-force-https").forceAzureHTTPS;

app.use(forceAzureHTTPS);
```

---
_Source: https://npm.io/package/expressjs-force-https · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
