# @kittgen/nestjs-https-redirect

> Kittgen HTTPS redirect middleware for NestJS.

Latest version **1.0.2** (published 2021-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kittgen/nestjs-https-redirect
pnpm add @kittgen/nestjs-https-redirect
yarn add @kittgen/nestjs-https-redirect
bun add @kittgen/nestjs-https-redirect
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-01-21 |
| First published | 2021-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 13.5 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 46 |
| Author | Ottgar |
| Maintainers | edgar.m.mueller, ottovw |
| Keywords | https, redirect, middleware, security, library, nest, nestjs |

## Links

- npm: https://www.npmjs.com/package/@kittgen/nestjs-https-redirect
- Repository: https://github.com/kittgen/kittgen-nestjs
- Homepage: https://github.com/kittgen/kittgen-nestjs#readme
- Issues: https://github.com/kittgen/kittgen-nestjs/issues
- npm.io page: https://npm.io/package/@kittgen/nestjs-https-redirect

## Dependencies (4)

- [@nestjs/core](https://npm.io/package/@nestjs/core.md) ^7.6.5
- [@nestjs/common](https://npm.io/package/@nestjs/common.md) ^7.6.4
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [@nestjs/platform-express](https://npm.io/package/@nestjs/platform-express.md) ^7.6.5

## 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

- 1.0.2 (latest) — 2021-01-21
- 1.0.1 — 2021-01-17

## README

# Kittgen Nestjs HTTPS redirect middleware

HTTPS redirect middleware for Nestjs.

[Check the main page for Kittgen](../../README.md) for further information.

## Usage

### Installation

```bash
npm i @kittgen/nestjs-https-redirect
```

### Register your middleware

#### Add Middleware to ApplicationModule

Further explanations about middlewares can be found in the [Nestjs documentation](https://docs.nestjs.com/middleware#applying-middleware).

```ts
export class ApplicationModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(HttpsRedirectMiddleware({ enabled: true })).forRoutes({
      path: '*',
      method: RequestMethod.ALL,
    });
  }
}
```
#### Reverse Proxys

If you're behind a reverse proxy (e.g. Heroku or nginx) make sure to enable `trust proxy` for your express app:

```js
app.enable('trust proxy');
```

## Local Development

### Local Library Development

#### Important Commands

```bash
# start in watcher mode
npm start

# builds to the 'dist' folder
npm run build

# runs the tests
npm test
```

#### Commits

We use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for nice commit messages and automated versioning/changelog.

This packages uses [TSDX](https://github.com/jaredpalmer/tsdx).

## License

Kittgen is licensed under MIT. See LICENSE.

## Authors

Kittgen is developed by Otto von Wesendonk and Edgar Müller.

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