From a663844d64f1c4b03595ee2bf08bbf4466c07937 Mon Sep 17 00:00:00 2001 From: Michael Pretorius Date: Fri, 24 May 2024 08:14:53 +0200 Subject: [PATCH] chore: remove auth from / healthcheck --- .nvmrc copy | 1 + package.json | 2 +- src/app.module.ts | 11 +++++++++-- src/main.ts | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .nvmrc copy diff --git a/.nvmrc copy b/.nvmrc copy new file mode 100644 index 0000000..85aee5a --- /dev/null +++ b/.nvmrc copy @@ -0,0 +1 @@ +v20 \ No newline at end of file diff --git a/package.json b/package.json index 97e52b4..2ac3467 100644 --- a/package.json +++ b/package.json @@ -79,4 +79,4 @@ "coverageDirectory": "../coverage", "testEnvironment": "node" } -} +} \ No newline at end of file diff --git a/src/app.module.ts b/src/app.module.ts index 278b638..8f11f00 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,11 +1,18 @@ -import { Module } from '@nestjs/common'; +import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { AppController } from './app.controller'; import { AppService } from './app.service'; +import { authorization } from './auth.middleware'; @Module({ imports: [ConfigModule.forRoot()], controllers: [AppController], providers: [AppService], }) -export class AppModule {} + +export class AppModule implements NestModule { + configure(consumer: MiddlewareConsumer) { + consumer.apply(authorization).exclude('/').forRoutes('*'); + } +} + diff --git a/src/main.ts b/src/main.ts index 7a93cb9..925f06a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,7 +8,7 @@ require('dotenv').config(); async function bootstrap() { const app = await NestFactory.create(AppModule, { cors: true }); - app.use(authorization); + Sentry.init({ dsn: process.env.SENTRY_DSN, maxValueLength: 5000,