{"size": 382, "ext": "js", "max_stars_repo_path": "src/server/src/controller/health.js", "max_stars_repo_name": "g-hoang/cla-assistant", "max_stars_repo_stars_event_min_datetime": "2015-02-10T09:47:32.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T12:57:28.000Z", "max_issues_repo_path": "src/server/src/controller/health.js", "max_issues_repo_name": "g-hoang/cla-assistant", "max_issues_repo_issues_event_min_datetime": "2015-01-02T14:05:12.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T10:54:24.000Z", "max_forks_repo_path": "src/server/src/controller/health.js", "max_forks_repo_name": "g-hoang/cla-assistant", "max_forks_repo_forks_event_min_datetime": "2015-03-04T08:47:11.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-27T10:16:52.000Z"}
{"max_stars_count": 1027, "max_issues_count": 780, "max_forks_count": 252, "avg_line_length": 19.1, "max_line_length": 50, "alphanum_fraction": 0.6413612565}
const express = require('express');
const router = express.Router();

router.get('/health/readiness', (req, res) => {
  if (!hasValidHealthCheckHeader(req)) {
    return res.status(400).end();
  }

  return res
    .status(200)
    .send('OK')
    .end();
});

function hasValidHealthCheckHeader(req) {
  return req.header('x-health-check') === 'check';
}

module.exports = router;
