1.0.2 • Published 3 years ago

@kittgen/nestjs-https-redirect v1.0.2

Weekly downloads
30
License
MIT
Repository
github
Last release
3 years ago

Kittgen Nestjs HTTPS redirect middleware

HTTPS redirect middleware for Nestjs.

Check the main page for Kittgen for further information.

Usage

Installation

npm i @kittgen/nestjs-https-redirect

Register your middleware

Add Middleware to ApplicationModule

Further explanations about middlewares can be found in the Nestjs documentation.

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:

app.enable('trust proxy');

Local Development

Local Library Development

Important Commands

# start in watcher mode
npm start

# builds to the 'dist' folder
npm run build

# runs the tests
npm test

Commits

We use conventional commits for nice commit messages and automated versioning/changelog.

This packages uses TSDX.

License

Kittgen is licensed under MIT. See LICENSE.

Authors

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