2022-10-09 22:30:32 +02:00
|
|
|
import { ClassSerializerInterceptor, ValidationPipe } from "@nestjs/common";
|
|
|
|
import { NestFactory, Reflector } from "@nestjs/core";
|
|
|
|
import * as fs from "fs";
|
|
|
|
import { AppModule } from "./app.module";
|
|
|
|
async function bootstrap() {
|
|
|
|
const app = await NestFactory.create(AppModule);
|
|
|
|
app.useGlobalPipes(new ValidationPipe());
|
|
|
|
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
|
|
|
|
|
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();
|