{"id":13716639,"url":"https://github.com/fmiras/micro-health","last_synced_at":"2025-08-22T18:32:45.350Z","repository":{"id":57296426,"uuid":"125881853","full_name":"fmiras/micro-health","owner":"fmiras","description":"An extension of micro with a Health Check API","archived":false,"fork":false,"pushed_at":"2020-03-24T18:50:35.000Z","size":217,"stargazers_count":20,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-03T17:26:18.043Z","etag":null,"topics":["health","health-check","micro","microservices"],"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/fmiras.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-03-19T15:43:24.000Z","updated_at":"2022-12-26T07:35:25.000Z","dependencies_parsed_at":"2022-09-07T03:20:38.005Z","dependency_job_id":null,"html_url":"https://github.com/fmiras/micro-health","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/fmiras/micro-health","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmiras%2Fmicro-health","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmiras%2Fmicro-health/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmiras%2Fmicro-health/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmiras%2Fmicro-health/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmiras","download_url":"https://codeload.github.com/fmiras/micro-health/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmiras%2Fmicro-health/sbom","scorecard":{"id":405477,"data":{"date":"2025-08-11","repo":{"name":"github.com/fmiras/micro-health","commit":"282536c8bd3b066e3b0c3f14c9c6e88856a338c9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","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":"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":"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":"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":"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":"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":"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 27 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-18T21:08:56.201Z","repository_id":57296426,"created_at":"2025-08-18T21:08:56.201Z","updated_at":"2025-08-18T21:08:56.201Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271681608,"owners_count":24802078,"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-08-22T02:00:08.480Z","response_time":65,"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":["health","health-check","micro","microservices"],"created_at":"2024-08-03T00:01:12.840Z","updated_at":"2025-08-22T18:32:44.981Z","avatar_url":"https://github.com/fmiras.png","language":"JavaScript","funding_links":[],"categories":["Modules"],"sub_categories":["Utilities"],"readme":"# micro-health\n[![NPM version](https://img.shields.io/npm/v/micro-health.svg)](https://www.npmjs.com/package/micro-health)\n[![Build Status](https://travis-ci.org/fmiras/micro-health.svg?branch=master)](https://travis-ci.org/fmiras/micro-health)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)\n[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/micro)\n[![Greenkeeper badge](https://badges.greenkeeper.io/fmiras/micro-health.svg)](https://greenkeeper.io/)\n\nmicro-health is used as an extension for micro to add the route `/health` to your service. It was meant to implement the Health Check API microservice design pattern for microservices monitoring. For long read I suggest reading [this page](http://microservices.io/patterns/observability/health-check-api.html).\n\n## Usage\n\n```bash\ncd my-micro-project/\nnpm install --save micro-health\n```\n\nand add use the package like this:\n\n```javascript\n// index.js\nconst health = require('micro-health')\n\nconst microFn = () =\u003e 'Hello World'\nmodule.exports = health(microFn)\n```\n\nthen just run your microservice normally and it will expose a `/health` endpoint.\n\nBy default the health request it will return you an HTTP 200 response with a 'success' message and it will fail if the microservice isn't available, this guarantees that your microservice is working or not regardless of the other functions of microservice itself. Also it supports a custom errorChecker:\n\n```javascript\n// index.js\nconst health = require('micro-health')\n\nconst microFn = (req, res) =\u003e {\n  // Wonderful code\n}\n\nconst errorChecker = async () =\u003e {\n  // Check if database pool connection is full\n  // Check if there is still space on filesystem\n  // Check if external APIs are working\n  try {\n    await customChecking()\n   catch (e) {\n     return { error: e }\n   }\n  // You can also return false to pass the health checking\n}\n\nmodule.exports = health(microFn, errorChecker)\n```\n\nIf error aren't falsy the health request will return an HTTP 500 response with the returned object by the error checker.\n\nThere are several tools for health checking such us:\n- [Microservice Graph Explorer](https://github.com/hootsuite/microservice-graph-explorer)\n- [nginx](https://github.com/nginxinc/NGINX-Demos/tree/master/fun-with-health-checks)\n- [CoScale](https://www.coscale.com)\n\nOr... you can just build your own!\n\n## Contributing\n\n1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device\n2. Link the package to the global module directory: `npm link`\n3. Within the module you want to test your local development instance of micro-cacheable, just link it to the dependencies: `npm link micro-health`. Instead of the default one from npm, node will now use your clone of micro-health!\n\n## Credits\n\nThanks to [ZEIT](https://zeit.co) Team for giving us [micro](https://github.com/zeit/micro) to make our life easier!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmiras%2Fmicro-health","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmiras%2Fmicro-health","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmiras%2Fmicro-health/lists"}