UNPKG

ams-ssk

Version:

NestJS AMS Library for file management

45 lines 1.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); require('dotenv').config(); const core_1 = require("@nestjs/core"); const app_module_1 = require("./app.module"); const swagger_config_1 = require("./config/swagger.config"); const common_1 = require("@nestjs/common"); async function bootstrap() { const app = await core_1.NestFactory.create(app_module_1.AppModule, { logger: ['error', 'warn', 'log', 'debug', 'verbose'], }); (0, swagger_config_1.setupSwagger)(app); app.useGlobalPipes(new common_1.ValidationPipe({ whitelist: true, transform: true, forbidNonWhitelisted: true, transformOptions: { enableImplicitConversion: true, }, })); const corsOptions = { origin: '*', methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS', allowedHeaders: 'Content-Type, Accept, Authorization', credentials: true, }; app.enableCors(corsOptions); await app.listen(8000); } process.on('unhandledRejection', (reason, promise) => { console.error('Unhandled Rejection at:', promise, 'reason:', reason); }); process.on('uncaughtException', (error) => { console.error('Uncaught Exception:', error); }); process.on('SIGTERM', async () => { console.log('Received SIGTERM signal. Starting graceful shutdown...'); process.exit(0); }); process.on('SIGINT', async () => { console.log('Received SIGINT signal. Starting graceful shutdown...'); process.exit(0); }); bootstrap(); //# sourceMappingURL=main.js.map