Skip to content

Commit

Permalink
Merge pull request #32 from drips-network/jason/assert-started-in-hea…
Browse files Browse the repository at this point in the history
…lth-endpoint

assertStarted in health endpoint
  • Loading branch information
efstajas authored Oct 16, 2024
2 parents 117db10 + c512e50 commit 4368311
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ const startServer = async () => {
app.set('trust proxy', 1);

app.route('/health').get((_, res) => {
try {
server.assertStarted('/health');
} catch (error) {
res.status(500).send('Server not ready');
return;
}

res.status(200).send('OK');
});

Expand Down

0 comments on commit 4368311

Please sign in to comment.