{"size": 986, "ext": "js", "max_stars_repo_path": "routes/docs/index.js", "max_stars_repo_name": "OpenCoreCMS/cms-api", "max_stars_repo_stars_event_min_datetime": "2020-11-11T14:34:46.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-11T14:34:46.000Z", "max_issues_repo_path": "routes/docs/index.js", "max_issues_repo_name": "OpenPublishingPlatform/opp-bff", "max_issues_repo_issues_event_min_datetime": "2021-10-04T20:27:25.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-04T20:35:01.000Z", "max_forks_repo_path": "routes/docs/index.js", "max_forks_repo_name": "OpenCoreCMS/cms-api", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 28.1714285714, "max_line_length": 91, "alphanum_fraction": 0.6835699797}
const markup = `
<html>
<body>

<h1>Endpoints - OpenCoreCMS API 0.1.0</h1>
<ul>
  <li>${generateLink('/api/v1/users/getCurrentUser')}</li>
  <li>${generateLink('/api/v1/users/login[post]')}</li>
  <li>${generateLink('/api/v1/users/logout')}</li>

  <li>${generateLink('/api/v1/settings/getSettingValue/$SETTING_NAME')}</li>

  <li>${generateLink('/api/v1/pages/getPage/$PAGE_ID')}</li>

  <li>${generateLink('/api/v1/publications/search')}</li>
  <li>${generateLink('/api/v1/publications/journals/getAllJournals')}</li>
  <li>${generateLink('/api/v1/publications/journals/$JOURNAL_ID/getJournal')}</li>
  <li>${generateLink('/api/v1/publications/journals/$JOURNAL_ID/getCurrentIssue')}</li>
  <li>${generateLink('/api/v1/publications/journals/articles/$ARTICLE_ID/getArticle')}</li>
</ul>

</body>
</html>
`;

function generateLink(link) {
  return `<a href="${link}">${link}</a>`;
}

function docsPageHandler(req, res) {
  return res.send(markup);
}

module.exports = docsPageHandler;
