forked from team0102/weather-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
27 lines (26 loc) · 820 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { NestFactory } from '@nestjs/core';
import { AppModule } from './src/app.module';
import * as dotenv from 'dotenv';
import { ValidationPipe } from '@nestjs/common';
async function bootstrap() {
dotenv.config();
const app = await NestFactory.create(AppModule);
app.enableCors();
// app.enableCors({
// // 소셜로그인을 위한 설정(바로 위 한줄짜리 cors가 기존 설정)
// origin: function (origin, callback) {
// callback(null, true);
// },
// });
app.useGlobalPipes(
new ValidationPipe({
transform: true,
transformOptions: {
enableImplicitConversion: true,
//excludeExtraneousValues: true, // 파일 업로드 시에 필드에 대한 유효성 검사 제외
},
}),
);
await app.listen(process.env.PORT);
}
bootstrap();