Files
fabric_trade_server/dist/main.js
T
mohmdsdgandCursor 345a4a4708 Add SMS OTP, harden auth, and fix order/checkout server bugs.
Ship 4-digit OTP with rate-limit attempts, Tehran-safe expiry/rass math, larger JSON body limit for check images, and safer order pricing/status guards. Include rebuilt dist for prebuilt deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 14:55:26 +03:30

39 lines
1.6 KiB
JavaScript

"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