From 73c8ee4d1826292f0fb8ae402a6d9df61a1c6646 Mon Sep 17 00:00:00 2001 From: pinomaker-hoo Date: Sat, 19 Aug 2023 14:31:10 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20Add=20=EC=A3=BC=EC=84=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main.ts b/src/main.ts index c13381b..6edd32c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,18 +18,35 @@ import { NestExpressApplication } from '@nestjs/platform-express'; import { AllExceptionsFilter } from './filter/ExceptionFilter'; async function bootstrap() { + // ** Server Container 생성 const app = await NestFactory.create(AppModule, { bufferLogs: true, }); + + // ** Logger app.useLogger(app.get(LoggerService)); + + // ** FIlter 개념 app.useGlobalFilters(new AllExceptionsFilter()); + + // ** Global Pipe Line app.useGlobalPipes(new ValidationPipe()); + + // ** Cors Setting app.enableCors(); + + // ** Static Rouing app.use('/file', express.static('./uploads')); + + // ** View Setting app.useStaticAssets(join(__dirname, '..', 'public')); app.setBaseViewsDir(join(__dirname, '..', 'src/views')); app.setViewEngine('hbs'); + + // ** Swagger Setting swaggerConfig(app); + + // ** Server ON Handler await app.listen(process.env.SERVER_PORT); } bootstrap();