"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@nestjs/core"); const common_1 = require("@nestjs/common"); const swagger_1 = require("@nestjs/swagger"); const express_1 = require("express"); const app_module_1 = require("./app.module"); async function bootstrap() { const app = await core_1.NestFactory.create(app_module_1.AppModule); const bodyLimit = process.env.BODY_LIMIT || '25mb'; app.use((0, express_1.json)({ limit: bodyLimit })); app.use((0, express_1.urlencoded)({ extended: true, limit: bodyLimit })); const globalPrefix = process.env.GLOBAL_PREFIX || 'api'; app.setGlobalPrefix(globalPrefix); app.enableCors({ origin: true, credentials: true, }); app.useGlobalPipes(new common_1.ValidationPipe({ whitelist: true, transform: true, forbidNonWhitelisted: true, transformOptions: { enableImplicitConversion: true }, })); const swaggerConfig = new swagger_1.DocumentBuilder() .setTitle('Fabric Trade API') .setDescription('API سرور تجارت پارچه') .setVersion('1.0') .addBearerAuth() .build(); const document = swagger_1.SwaggerModule.createDocument(app, swaggerConfig); swagger_1.SwaggerModule.setup(`${globalPrefix}/docs`, app, document); const port = process.env.PORT ?? 3000; await app.listen(port); console.log(`Fabric Trade API listening on http://localhost:${port}/${globalPrefix}`); console.log(`Swagger docs at http://localhost:${port}/${globalPrefix}/docs`); } void bootstrap(); //# sourceMappingURL=main.js.map