{"id":24383348,"url":"https://github.com/firstandthird/hapi-docs","last_synced_at":"2026-04-25T10:36:01.442Z","repository":{"id":54180183,"uuid":"120942910","full_name":"firstandthird/hapi-docs","owner":"firstandthird","description":"a lout-like plugin for hapi that generates API documentation for routes","archived":false,"fork":false,"pushed_at":"2021-03-04T21:14:21.000Z","size":124,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-26T21:59:22.560Z","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/firstandthird.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-02-09T18:49:31.000Z","updated_at":"2021-03-04T21:14:17.000Z","dependencies_parsed_at":"2022-08-13T08:31:05.500Z","dependency_job_id":null,"html_url":"https://github.com/firstandthird/hapi-docs","commit_stats":null,"previous_names":["firstandthird/hapi-api-docs"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/firstandthird/hapi-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstandthird","download_url":"https://codeload.github.com/firstandthird/hapi-docs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-docs/sbom","scorecard":{"id":401053,"data":{"date":"2025-08-11","repo":{"name":"github.com/firstandthird/hapi-docs","commit":"461c847c1fd76f01068e9e7193aac1bd5640ae6f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":4,"reason":"Found 7/17 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T20:06:27.799Z","repository_id":54180183,"created_at":"2025-08-18T20:06:27.799Z","updated_at":"2025-08-18T20:06:27.799Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32259472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2025-01-19T10:14:18.286Z","updated_at":"2026-04-25T10:36:01.417Z","avatar_url":"https://github.com/firstandthird.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hapi-docs\n\nAn indispensable [hapi](https://hapi.dev/) plugin that automatically documents the\nmajor features of your hapi server\n\nhapi-docs will document:\n\n- routes\n\n- server methods\n\n- server events\n\n- server plugins\n\n- server auth schemes\n\n## Installation\n\n```console\nnpm install hapi-docs\n```\n\n## Usage\n\n    hapi-docs is a standard hapi plugin, the quickest way to use it is to just register it like so:\n\n```js\nawait server.register({\n  plugin: require('hapi-docs'),\n  options: {\n    docsEndpoint: '/docs'\n  }\n});\n\n```\n\nand this will register a route at __/docs__ that will return server information in HTML form.  In addition this will decorate\nyour server with a _server.docs_ object that provides a set of functions that return document information.\n\n- _server.docs.plugins()_\n\n  Just returns the result of [_server.registrations_](https://hapi.dev/api/?v=20.1.0#-serverregistrations)\n\n- _server.docs.events()_\n\n  Will list all of your registered server events and listeners like so:\n\n  ```js\n  {\n    log: { handlers: ['foo1', 'foo2'] },\n    request: { handlers: ['debug'] },\n    response: { handlers: ['(anonymous)'] },\n    route: { handlers: ['foo2'] }\n  }\n  ```\n\n- _server.docs.routes(options)_\n\n  Will return a list of the server route configuration and corresponding joi validation data like so:\n\n  ```js\n  [{\n    path: '/someRoute',\n    method: 'post',\n    payload: {\n      type: 'object',\n      children: {\n        name: {\n          type: 'string',\n          flags: { presence: 'required' },\n          invalids: ['']\n        },\n        hash: {\n          type: 'string',\n          flags: { presence: 'required' },\n          invalids: ['']\n        },\n        id: {\n          type: 'string',\n          flags: { presence: 'required' },\n          invalids: ['']\n        }\n      }\n    }\n  }]\n  ```\n\n  _options_ can contain a comma-separated list of _tags_  in string form, so that you only list out the routes that match that tag:\n\n  ```js\n  server.docs.routes({ tags: 'secure,api' });\n  ```\n\n  will only list info for routes that have the 'secure' or 'api' tag.\n\n- _server.docs.auth(routeList)_\n\n  Takes in a list of route configurations (which you can get by calling _server.docs.routes()_) and returns a corresponding list of auth strategies for the routes passed:\n\n  ```js\n     [{ name: 'local' }, { name: 'default' }]\n  ```\n\n- _server.docs.methods()_\n\n  Returns the list of server methods and any associated meta-data. For example if you define a function with annotiations like so:\n\n  ```js\n  const annotated = function func3() {\n    return 'scheme';\n  };\n  annotated.schema = {\n    payload: {\n      id: Joi.string().required(),\n    }\n  };\n  annotated.description = 'A function that has some annotations';\n  server.method('func3', annotated);\n  ```\n\n  Calling _server.docs.methods()_ returns:\n  ```js\n  [{\n      name: 'func3',\n      description: 'A function that has some annotations',\n      schema: {\n        type: 'object',\n        children: {\n          payload: {\n            type: 'object',\n            children: {\n              id: {\n                type: 'string',\n                flags: { presence: 'required' },\n                invalids: ['']\n              },\n            }\n          }\n        }\n      }\n    },]\n  ```\n\n- _server.docs.html()_\n\n  This will return a tidy HTML page listing out the methods, routes, auth, events, and plugins data.\n\n### Options\n\n  - __getMeta__\n\n    You can pass a getMeta function that returns an object containing additional information you want documented for your server, eg:\n\n    ```js\n    await server.register({\n      plugin: require('../'),\n      options: {\n        getMeta: {\n          routes: {\n            '/some/{name}/page': {\n              description: 'really this is a good route',\n              tags: ['meta']\n            }\n          },\n          methods: {\n            'api.create': {\n              description: 'a meta description',\n              tags: ['meta']\n            }\n          },\n          events: {\n            response: {\n              description: 'triggered when a route responds to a request'\n            }\n          },\n          strategies: {\n            local: {\n              description: 'lets everyone in'\n            },\n            default: {\n              description: 'nobody gets in'\n            }\n          }\n        }\n      }\n    });\n    ```\n\n  - __docsEndpoint__\n\n  You can pass an endpoint to register a route that allows you to fetch the HTML version of the server docs.  You can also pass __?tags=tag1,tag2__ in the request query to list only routes that match the indicated tags.\n\n  ```js\n  await server.register({\n    plugin: require('../'),\n    options: {\n      docsEndpoint: '/docsEndpoint'\n    }\n  });\n  ```\n\nThen you can GET __/docsEndpoint__ and get back a page listing your server docs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstandthird%2Fhapi-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstandthird%2Fhapi-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstandthird%2Fhapi-docs/lists"}