Files
fabric_trade_server/dist/main.js
T
mohmdsdgandCursor b121797263 Support LiteSpeed /server path via GLOBAL_PREFIX
Allow Nest prefix server/api and overlay dist from git onto the deploy bundle so proxy paths match without a full retar.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 09:55:57 +03:30

35 lines
1.4 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 app_module_1 = require("./app.module");
async function bootstrap() {
const app = await core_1.NestFactory.create(app_module_1.AppModule);
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`);
}
bootstrap();
//# sourceMappingURL=main.js.map