|
import { NestFactory } from '@nestjs/core';
|
|
import { AppModule } from './app.module';
|
|
import * as bodyParser from 'body-parser';
|
|
import { ValidationPipe } from '@nestjs/common';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
|
|
app.useGlobalPipes(new ValidationPipe());
|
|
|
|
|
|
app.enableCors({
|
|
origin: '*',
|
|
|
|
methods: '*',
|
|
credentials: true,
|
|
});
|
|
|
|
app.use(bodyParser.urlencoded({ extended: true }));
|
|
app.use(bodyParser.json());
|
|
|
|
|
|
const port = process.env.PORT || 7860;
|
|
|
|
await app.listen(port);
|
|
}
|
|
bootstrap();
|
|
|