You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
992 B

3 weeks ago
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@nestjs/core");
const app_module_1 = require("./app.module");
const common_1 = require("@nestjs/common");
2 weeks ago
const swagger_1 = require("@nestjs/swagger");
3 weeks ago
async function bootstrap() {
const app = await core_1.NestFactory.create(app_module_1.AppModule);
2 weeks ago
if (process.env.NODE_ENV !== 'production')
app.enableCors();
3 weeks ago
app.useGlobalPipes(new common_1.ValidationPipe({
whitelist: true,
forbidNonWhitelisted: true,
transform: true,
}));
2 weeks ago
const config = new swagger_1.DocumentBuilder()
.setTitle('API DOC')
.setDescription('API Document')
.setVersion('0.1')
.addBearerAuth()
.build();
const document = swagger_1.SwaggerModule.createDocument(app, config);
swagger_1.SwaggerModule.setup('api', app, document);
3 weeks ago
await app.listen(process.env.PORT ?? 3000);
}
bootstrap();
//# sourceMappingURL=main.js.map