feat: Better startup and failure message for backend

This commit is contained in:
jamesread 2024-09-16 07:28:35 +01:00
parent b84c86c723
commit 94ad61a35e
1 changed files with 8 additions and 2 deletions

View File

@ -35,8 +35,14 @@ async function bootstrap() {
loadSwagger(app);
const port = process.env.PORT || 3000;
await app.listen(port);
Logger.log(`🚀 Application is running on: http://localhost:${port}`);
try {
await app.listen(port);
Logger.log(`🚀 Backend is running on: http://localhost:${port}`);
} catch (e) {
Logger.error(`Backend failed to start on port ${port}`, e);
}
}
bootstrap();