Skip to content

Commit

Permalink
add endpoint to check health
Browse files Browse the repository at this point in the history
  • Loading branch information
arieschwartzman committed Dec 29, 2023
1 parent 006ec6a commit b54cb0f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ npm start
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWRpZW5jZSI6InlvdXJfYXVkaWVuY2UiLCJpYXQiOjE1MTYyMzkwMjIsImV4cCI6MTUxNjI0MjYyMn0.ih1a0wR5p07s7B8eIiKA7TbCqxGVuCwK3I2C6l1BwEI"
}
```
- `GET /health` - Checks the health of the application.

For example:

```bash
curl -X GET https://{host}/health
```

If the application is running properly, you will receive a response like this:

```json
{
"status": "Healthy"
}
```

## Built With

Expand Down
5 changes: 5 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ app.post('/sign', (req: Request, res: Response) => {

});

// Endpoint to check health
app.get('/health', (req: Request, res: Response) => {
res.json({ status: 'Healthy' });
});

app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});

0 comments on commit b54cb0f

Please sign in to comment.