-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add is alive and is healthy endpoints
- Loading branch information
1 parent
c3c462a
commit de7827e
Showing
3 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import express, { Request, Response, Router } from 'express' | ||
import { nestedCountersInstance } from '../utils/nestedCounters' | ||
|
||
export const healthCheckRouter: Router = express.Router() | ||
|
||
healthCheckRouter.get('/is-alive', (req: Request, res: Response) => { | ||
nestedCountersInstance.countEvent('api', 'is-alive') | ||
return res.status(200); | ||
}) | ||
|
||
healthCheckRouter.get('/is-healthy', (req: Request, res: Response) => { | ||
// TODO: Add actual health check logic | ||
nestedCountersInstance.countEvent('api', 'health-check') | ||
return res.status(200); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters