{"id":15365943,"url":"https://github.com/andywer/koa-router-index","last_synced_at":"2025-07-31T04:33:24.286Z","repository":{"id":57289466,"uuid":"103452571","full_name":"andywer/koa-router-index","owner":"andywer","description":"Koa v2 middleware to create an index page for API servers.","archived":false,"fork":false,"pushed_at":"2019-03-22T19:42:40.000Z","size":242,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-01T12:53:24.523Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andywer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-13T21:26:11.000Z","updated_at":"2019-03-23T09:41:31.000Z","dependencies_parsed_at":"2022-09-20T07:12:08.718Z","dependency_job_id":null,"html_url":"https://github.com/andywer/koa-router-index","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/andywer/koa-router-index","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkoa-router-index","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkoa-router-index/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkoa-router-index/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkoa-router-index/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andywer","download_url":"https://codeload.github.com/andywer/koa-router-index/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkoa-router-index/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267988295,"owners_count":24176990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T13:16:45.494Z","updated_at":"2025-07-31T04:33:24.262Z","avatar_url":"https://github.com/andywer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa-router-index\n\n[![Build Status](https://travis-ci.org/andywer/koa-router-index.svg?branch=master)](https://travis-ci.org/andywer/koa-router-index) [![NPM Version](https://img.shields.io/npm/v/koa-router-index.svg)](https://www.npmjs.com/package/koa-router-index) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\nMiddleware to generate an index page for REST API services. For usage with [koa](https://github.com/koajs/koa) v2 and [koa-router](https://github.com/alexmingoia/koa-router).\n\nWhy? Because an API service should tell you which endpoints it provides. You should not have to google the service's documentation to be able to use it.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Screenshot\" width=\"600px\" src=\"https://github.com/andywer/koa-router-index/raw/master/docs/sample-page.png?raw=true\" /\u003e\n\u003c/p\u003e\n\n\n## Installation\n\n```sh\nnpm install --save koa-router-index\n```\n\n\n## Usage\n\n```js\nconst IndexPage = require('koa-router-index')\n\napp.use(\n  IndexPage(koaRouter, options /* (optional) */)\n)\n```\n\nA more comprehensive example:\n\n```js\nconst Koa = require('koa')\nconst Router = require('koa-router')\nconst IndexPage = require('koa-router-index')\n\nconst router = new Router()\n  .get('/user/:id', userHandler)\n  .get('/status', statusHandler)\n\nconst app = new Koa()\n  .use(router.routes())\n  .use(IndexPage(router, { meta: { name: 'My fancy API server' } }))\n  // or\n  .use(IndexPage(router, { meta: require('./package.json') }))\n```\n\n\n## Options\n\n### meta: Object\n\nProperties (all optional):\n\n- `name` - The name of the service.\n- `description` - A short description of the service.\n\nThe property names match the ones in `package.json`, so you can just pass your parsed `package.json` here.\n\n### excludeMethods: String[]\n\nArray of HTTP methods to ignore when creating the index page. Defaults to `[ 'HEAD' ]`.\n\n### prefix: String\n\nThe prefix to add the index under.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandywer%2Fkoa-router-index","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandywer%2Fkoa-router-index","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandywer%2Fkoa-router-index/lists"}