Initial LinkedSign platform
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
const healthService = require('./health.service');
|
||||
const { sendSuccess } = require('../../utils/apiResponse');
|
||||
|
||||
const getHealth = async (req, res, next) => {
|
||||
try {
|
||||
const result = await healthService.getHealth();
|
||||
return sendSuccess(res, result);
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getHealth,
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
const getStatus = async () => {
|
||||
return {
|
||||
status: 'ok',
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getStatus,
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
const express = require('express');
|
||||
const healthController = require('./health.controller');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', healthController.getHealth);
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,14 @@
|
||||
const healthRepository = require('./health.repository');
|
||||
|
||||
const getHealth = async () => {
|
||||
const baseStatus = await healthRepository.getStatus();
|
||||
|
||||
return {
|
||||
...baseStatus,
|
||||
timestamp: new Date().toISOString(),
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getHealth,
|
||||
};
|
||||
Reference in New Issue
Block a user