mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
19 lines
694 B
TypeScript
19 lines
694 B
TypeScript
import { ClassSerializerInterceptor, ValidationPipe } from "@nestjs/common";
|
|
import { NestFactory, Reflector } from "@nestjs/core";
|
|
import { NestExpressApplication } from "@nestjs/platform-express";
|
|
import * as fs from "fs";
|
|
import { AppModule } from "./app.module";
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
|
app.useGlobalPipes(new ValidationPipe({ whitelist: true }));
|
|
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
|
|
|
|
app.set("trust proxy", true);
|
|
|
|
await fs.promises.mkdir("./data/uploads/_temp", { recursive: true });
|
|
|
|
app.setGlobalPrefix("api");
|
|
await app.listen(8080);
|
|
}
|
|
bootstrap();
|