Kittgen HTTPS redirect middleware for NestJS.
npm install @kittgen/nestjs-https-redirectHTTPS redirect middleware for Nestjs.
Check the main page for Kittgen for further information.
``bash`
npm i @kittgen/nestjs-https-redirect
#### Add Middleware to ApplicationModule
Further explanations about middlewares can be found in the Nestjs documentation.
`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');
#### Important Commands
`bashstart in watcher mode
npm start
#### Commits
We use conventional commits for nice commit messages and automated versioning/changelog.
This packages uses TSDX.
Kittgen is licensed under MIT. See LICENSE.
Kittgen is developed by Otto von Wesendonk and Edgar Müller.