From af46fc0a163491e69d8c0f07e298fbc4fcf016c4 Mon Sep 17 00:00:00 2001 From: wlstmd Date: Tue, 16 Jul 2024 13:05:38 +0900 Subject: [PATCH] redirect --- src/app.controller.ts | 8 ++++++++ src/app.module.ts | 3 ++- src/main.ts | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/app.controller.ts diff --git a/src/app.controller.ts b/src/app.controller.ts new file mode 100644 index 0000000..d369aa0 --- /dev/null +++ b/src/app.controller.ts @@ -0,0 +1,8 @@ +import { Controller, Get, Redirect } from '@nestjs/common'; + +@Controller() +export class AppController { + @Get() + @Redirect('/auth/github/login', 302) + redirectToGithubLogin() {} +} diff --git a/src/app.module.ts b/src/app.module.ts index 4ad9220..70ce4e4 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -3,10 +3,11 @@ import { AuthModule } from './auth/auth.module'; import { ConfigModule } from '@nestjs/config'; import { LoggerMiddleware } from './middlewares/logger.middleware'; import { HealthModule } from './health/health.module'; +import { AppController } from './app.controller'; @Module({ imports: [ConfigModule.forRoot({ isGlobal: true }), AuthModule, HealthModule], - controllers: [], + controllers: [AppController], providers: [], }) export class AppModule implements NestModule { diff --git a/src/main.ts b/src/main.ts index a716abb..c59d81e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,7 +7,7 @@ declare const module: any; async function bootstrap() { try { const app = await NestFactory.create(AppModule, { cors: true }); - const port = 3000; + const port = 80; const config = new DocumentBuilder() .setTitle('API')