@kittgen/nestjs-https-redirect
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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.

Package Sidebar

Install

npm i @kittgen/nestjs-https-redirect

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

13.9 kB

Total Files

14

Last publish

Collaborators

  • edgar.m.mueller
  • ottovw