{"id":15680198,"url":"https://github.com/sholladay/hapi-hi","last_synced_at":"2025-03-30T09:28:07.292Z","repository":{"id":57260952,"uuid":"70118469","full_name":"sholladay/hapi-hi","owner":"sholladay","description":"Status route for your server.","archived":false,"fork":false,"pushed_at":"2020-01-13T17:39:38.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T00:25:06.621Z","etag":null,"topics":["check","hapi","health","heartbeat","ping","plugin","server","status"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sholladay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-06T03:07:52.000Z","updated_at":"2020-01-13T17:39:40.000Z","dependencies_parsed_at":"2022-08-31T12:22:29.764Z","dependency_job_id":null,"html_url":"https://github.com/sholladay/hapi-hi","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fhapi-hi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fhapi-hi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fhapi-hi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fhapi-hi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sholladay","download_url":"https://codeload.github.com/sholladay/hapi-hi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246300521,"owners_count":20755375,"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","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":["check","hapi","health","heartbeat","ping","plugin","server","status"],"created_at":"2024-10-03T16:40:48.836Z","updated_at":"2025-03-30T09:28:07.270Z","avatar_url":"https://github.com/sholladay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hapi-hi [![Build status for hapi Hi](https://travis-ci.com/sholladay/hapi-hi.svg?branch=master \"Build Status\")](https://travis-ci.com/sholladay/hapi-hi \"Builds\")\n\n\u003e Status route for your server\n\nThis [hapi](https://hapijs.com) plugin adds a `GET /status` route to your app so that you can check the health of your service by making an HTTP request.\n\n## Why?\n\n - Provides useful metrics about your server.\n - Response format is friendly to humans and machines.\n - Knowing service health helps you recover from errors.\n\n## Install\n\n```sh\nnpm install hapi-hi\n```\n\n## Usage\n\nRegister the plugin on your server to provide the health check endpoint.\n\n```js\nconst hapi = require('@hapi/hapi');\nconst hi = require('hapi-hi');\n\nconst server = hapi.server();\n\nconst init = async () =\u003e {\n    await server.register({\n        plugin  : hi,\n        options : {\n            cwd : __dirname\n        }\n    });\n    await server.start();\n    console.log('Server ready:', server.info.uri);\n};\n\ninit();\n```\n\nVisiting `/status` will return a JSON response with app info because of this plugin.\n\n```json\n{\n    \"appName\"    : \"my-project\",\n    \"appVersion\" : \"1.0.0\",\n    \"statusCode\" : 200,\n    \"status\"     : \"OK\",\n    \"time\"       : \"2016-10-06T13:48:10.586Z\",\n    \"process\"    : {\n        \"uptime\"  : 519163.478,\n        \"title\"   : \"node /srv/my-project/bin/my-project.js\",\n        \"version\" : \"12.0.0\",\n        \"pid\"     : 23794,\n    }\n}\n```\n\n## API\n\n### Routes\n\n#### GET /status\n\nTags: `health`, `monitor`, `status`\n\nReturns an object that contains properties useful for checking the status of your server, including `appName`, `appVersion`, `statusCode`, `status`, `time`, and a `process` object with details about the Node.js process.\n\n### Plugin options\n\nType: `object`\n\n#### cwd\n\nType: `string`\u003cbr\u003e\nDefault: `process.cwd()`\n\nWhere to begin a [find-up search](https://github.com/sindresorhus/read-pkg-up) for your project's package.json. Used to provide the name and version of your app in the status route response.\n\n#### noConflict\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nApply a `/__${appName}` prefix to the status route, where `${appName}` is replaced with the `name` from your package.json. This is useful for reverse proxies to remain transparent (e.g. ensure they don't accidentally block access to a file called `status`).\n\n## Contributing\n\nSee our [contributing guidelines](https://github.com/sholladay/hapi-hi/blob/master/CONTRIBUTING.md \"Guidelines for participating in this project\") for more details.\n\n1. [Fork it](https://github.com/sholladay/hapi-hi/fork).\n2. Make a feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. [Submit a pull request](https://github.com/sholladay/hapi-hi/compare \"Submit code to this project for review\").\n\n## License\n\n[MPL-2.0](https://github.com/sholladay/hapi-hi/blob/master/LICENSE \"License for hapi-hi\") © [Seth Holladay](https://seth-holladay.com \"Author of hapi-hi\")\n\nGo make something, dang it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsholladay%2Fhapi-hi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsholladay%2Fhapi-hi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsholladay%2Fhapi-hi/lists"}