Files
Yumi/src/routes/API/v1.ts
T

19 lines
448 B
TypeScript
Raw Normal View History

2022-08-26 06:36:45 +07:00
import * as express from 'express';
2023-03-05 14:46:25 +07:00
import Environment from '../../providers/Environment';
2022-08-26 06:36:45 +07:00
import HealthCheck from '../../controllers/API/v1/HealthCheck';
const router = express.Router();
let isDevEnv = (req: any, res: any, next: any) => {
2023-03-05 14:46:25 +07:00
if (Environment.get().NODE_ENV == 'development') {
2022-08-26 06:36:45 +07:00
return next();
2023-03-05 14:46:25 +07:00
} else {
2022-08-26 06:36:45 +07:00
return res.sendStatus(403);
}
};
router.get('/health', HealthCheck.perform);
2023-03-05 14:46:25 +07:00
export default router;