fix port definition

This commit is contained in:
Mamadou Khoussa [028918 DSI/DAC/DIF/DS] 2025-10-29 12:47:01 +00:00
parent 3d0d054f64
commit bf468ba8ae

View File

@ -25,11 +25,12 @@ async function bootstrap() {
app.getHttpAdapter().get('/api/swagger-json', (req, res) => { app.getHttpAdapter().get('/api/swagger-json', (req, res) => {
res.json(document); res.json(document);
}); });
const port = process.env.PORT || 3000;
await app.listen(process.env.PORT ?? 3000); await app.listen(port);
console.log(`Application is running on: http://localhost:3000`);
console.log(`Swagger docs: http://localhost:3000/api/docs`); console.log(`Application is running on: http://localhost:${port}`);
console.log(`Swagger content: http://localhost:3000/api/swagger-json`); console.log(`Swagger docs: http://localhost:${port}/api/docs`);
console.log(`Swagger docs: http://localhost:${port}/api/swagger-json`);
} }
bootstrap(); bootstrap();