Skip to content

Commit

Permalink
redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
wlstmd committed Jul 16, 2024
1 parent 975b99e commit af46fc0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Controller, Get, Redirect } from '@nestjs/common';

@Controller()
export class AppController {
@Get()
@Redirect('/auth/github/login', 302)
redirectToGithubLogin() {}
}
3 changes: 2 additions & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit af46fc0

Please sign in to comment.