23 lines
522 B
TypeScript
23 lines
522 B
TypeScript
import { ValidationPipe } from '@nestjs/common';
|
|
import { NestFactory } from '@nestjs/core';
|
|
import compression from 'compression';
|
|
import { AppModule } from './app.module';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
app.use(compression());
|
|
app.setGlobalPrefix('api');
|
|
|
|
app.useGlobalPipes(
|
|
new ValidationPipe({
|
|
transform: true,
|
|
whitelist: true,
|
|
forbidNonWhitelisted: true,
|
|
}),
|
|
);
|
|
|
|
await app.listen(process.env.PORT as string);
|
|
}
|
|
|
|
void bootstrap();
|