Skip to content

Commit

Permalink
feat(1.1c): Exit the server process on exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
one-aalam committed Jul 12, 2021
1 parent 7025757 commit e3cc662
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ const APP_PORT = process.env.APP_PORT || 3000

const server = buildSever()

server.listen(APP_PORT, () => console.log(`Server started on ${APP_PORT} 🚀`));
server.listen(APP_PORT, '0.0.0.0', (err) => {
if(err) {
console.error(err)
process.exit(1)
}
console.log(`Server started on ${APP_PORT} 🚀`)
});

0 comments on commit e3cc662

Please sign in to comment.