refactor: rename prestataire to constructeur

This commit is contained in:
Matthieu
2025-09-17 08:50:07 +02:00
parent 4d2d552391
commit e8aeaf98e9
36 changed files with 796 additions and 783 deletions

14
dist/main.js vendored
View File

@@ -5,8 +5,18 @@ const common_1 = require("@nestjs/common");
const app_module_1 = require("./app.module");
async function bootstrap() {
const app = await core_1.NestFactory.create(app_module_1.AppModule);
const allowedOrigins = process.env.CORS_ORIGIN
? process.env.CORS_ORIGIN.split(',').map(origin => origin.trim())
: ['http://localhost:3001'];
app.enableCors({
origin: process.env.CORS_ORIGIN || 'http://localhost:3001',
origin: (origin, callback) => {
if (!origin || allowedOrigins.includes(origin)) {
callback(null, true);
}
else {
callback(new Error(`Origin ${origin} not allowed by CORS`));
}
},
credentials: true,
});
app.useGlobalPipes(new common_1.ValidationPipe({
@@ -16,7 +26,7 @@ async function bootstrap() {
}));
const apiPrefix = process.env.API_PREFIX || 'api';
app.setGlobalPrefix(apiPrefix);
const port = process.env.PORT || 3000;
const port = Number(process.env.PORT) || 3000;
await app.listen(port);
console.log(`Application is running on: http://localhost:${port}`);
console.log(`Environment: ${process.env.NODE_ENV || 'development'}`);