-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70168f9
commit 14816ab
Showing
3 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import httpStatus from 'http-status'; | ||
|
||
import { AsyncUtils } from 'shared/utilities'; | ||
|
||
/** | ||
* Health Controller | ||
*/ | ||
export default class HealthController { | ||
|
||
/** | ||
* Method: GET, POST | ||
* | ||
* Path: /api/health/ | ||
*/ | ||
static healthCheck = AsyncUtils.asyncHandler(async (req, res) => { | ||
res.status(httpStatus.OK).send({ | ||
message: 'Hello World', | ||
}); | ||
}); | ||
} |
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,19 @@ | ||
import express from 'express'; | ||
|
||
import HealthController from './health.controller'; | ||
|
||
const HealthRouter = express.Router(); | ||
|
||
/** | ||
* Method: GET | ||
* Path: /api/health | ||
*/ | ||
HealthRouter.get('/', HealthController.healthCheck); | ||
|
||
/** | ||
* Method: POST | ||
* Path: /api/health | ||
*/ | ||
HealthRouter.post('/', HealthController.healthCheck); | ||
|
||
export default HealthRouter; |
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,7 @@ | ||
import HealthController from './health.controller'; | ||
import HealthRouter from './health.router'; | ||
|
||
export { | ||
HealthController, | ||
HealthRouter, | ||
}; |