2022-10-09 22:30:32 +02:00
|
|
|
import { ClassSerializerInterceptor, ValidationPipe } from "@nestjs/common";
|
|
|
|
import { NestFactory, Reflector } from "@nestjs/core";
|
2022-10-24 12:11:10 +02:00
|
|
|
import { NestExpressApplication } from "@nestjs/platform-express";
|
2022-10-09 22:30:32 +02:00
|
|
|
import * as fs from "fs";
|
|
|
|
import { AppModule } from "./app.module";
|
2022-10-24 12:11:10 +02:00
|
|
|
|
2022-10-09 22:30:32 +02:00
|
|
|
async function bootstrap() {
|
2022-10-24 12:11:10 +02:00
|
|
|
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
2022-10-09 22:30:32 +02:00
|
|
|
app.useGlobalPipes(new ValidationPipe());
|
|
|
|
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
|
|
|
|
|
2022-10-24 12:11:10 +02:00
|
|
|
app.set("trust proxy", true);
|
|
|
|
|
2022-10-12 00:38:38 +02:00
|
|
|
await fs.promises.mkdir("./data/uploads/_temp", { recursive: true });
|
2022-10-09 22:30:32 +02:00
|
|
|
|
|
|
|
app.setGlobalPrefix("api");
|
|
|
|
await app.listen(8080);
|
|
|
|
}
|
|
|
|
bootstrap();
|