Skip to content

Commit

Permalink
chore: remove auth from / healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelPretorius committed May 24, 2024
1 parent 449e995 commit a663844
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .nvmrc copy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
}
11 changes: 9 additions & 2 deletions src/app.module.ts
Original file line number Diff line number Diff line change
@@ -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('*');
}
}

2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a663844

Please sign in to comment.