Skip to content

Commit

Permalink
feat: Better startup and failure message for backend
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Sep 16, 2024
1 parent b84c86c commit 94ad61a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit 94ad61a

Please sign in to comment.