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')