Skip to content

Commit

Permalink
feature - health
Browse files Browse the repository at this point in the history
  • Loading branch information
space-hound committed Jan 9, 2023
1 parent 70168f9 commit 14816ab
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/features/health/health.controller.js
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',
});
});
}
19 changes: 19 additions & 0 deletions src/features/health/health.router.js
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;
7 changes: 7 additions & 0 deletions src/features/health/index.js
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,
};

0 comments on commit 14816ab

Please sign in to comment.