{"id":20782450,"url":"https://github.com/augusthome/server-health","last_synced_at":"2026-01-29T01:13:13.869Z","repository":{"id":32543689,"uuid":"136650344","full_name":"AugustHome/server-health","owner":"AugustHome","description":"Library to provide server health information via a HTTP server endpoint for express, restify, hapi, and vanilla http","archived":false,"fork":false,"pushed_at":"2025-04-23T21:44:44.000Z","size":1659,"stargazers_count":16,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-17T13:10:31.971Z","etag":null,"topics":["express","hapi","health-check","monitoring","nodejs","restify","server","server-health"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AugustHome.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-06-08T17:56:43.000Z","updated_at":"2025-04-23T21:44:42.000Z","dependencies_parsed_at":"2024-04-19T19:47:37.694Z","dependency_job_id":"31024721-c199-4dd8-a6aa-3ee5ebe72a49","html_url":"https://github.com/AugustHome/server-health","commit_stats":{"total_commits":214,"total_committers":8,"mean_commits":26.75,"dds":"0.16355140186915884","last_synced_commit":"ff2f5b7d0dbe95d35e61508dbb4e5b4082bc1d82"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/AugustHome/server-health","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustHome%2Fserver-health","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustHome%2Fserver-health/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustHome%2Fserver-health/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustHome%2Fserver-health/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AugustHome","download_url":"https://codeload.github.com/AugustHome/server-health/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustHome%2Fserver-health/sbom","scorecard":{"id":17706,"data":{"date":"2025-08-11","repo":{"name":"github.com/AugustHome/server-health","commit":"261a7c35cb40ef3235ee25158efbbd0cd3ff1d9c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"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":"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":10,"reason":"no dangerous workflow patterns detected","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":"Code-Review","score":2,"reason":"Found 2/7 approved changesets -- score normalized to 2","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/cibuild.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuild.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/AugustHome/server-health/cibuild.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuild.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/AugustHome/server-health/cibuild.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuild.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/AugustHome/server-health/cibuild.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cibuild.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/AugustHome/server-health/cibuild.yml/master?enable=pin","Warn: npmCommand not pinned by hash: scripts/bootstrap.sh:37","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   2 npmCommand dependencies pinned"],"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 25 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"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T16:08:43.643Z","repository_id":32543689,"created_at":"2025-08-14T16:08:43.643Z","updated_at":"2025-08-14T16:08:43.643Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280683958,"owners_count":26372970,"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-10-23T02:00:06.710Z","response_time":142,"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":["express","hapi","health-check","monitoring","nodejs","restify","server","server-health"],"created_at":"2024-11-17T14:11:14.062Z","updated_at":"2025-10-23T19:56:20.507Z","avatar_url":"https://github.com/AugustHome.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Server Health\n\n[![NPM](https://nodei.co/npm/server-health.png?downloads=true)](https://nodei.co/npm/server-health/)\n\nAllows to easily add a `/health` endpoint to a Fastify, Restify, Express, Hapi\nor native node http server returning vital information about a service.\n\n## Example output\n\n```json\n{\n  \"status\": \"ok\", // overall server status\n  \"uptime\": 3714, // uptime in seconds\n  \"upSince\": \"2017-05-12T03:13:06.462Z\",\n  \"service\": { // package.json meta data\n    \"name\": \"foobarbaz-server\",\n    \"description\": \"Foo Bar Baz Server\",\n    \"version\": \"0.14.0\",\n    \"repository\": {\n      \"type\": \"git\",\n      \"url\": \"git@example.com:foobarbaz-server.git\"\n    }\n  },\n  \"connections\": { // plugable connection checks\n    \"mongodb\": \"ok\",\n    \"redis\": \"ok\",\n    \"rabbitmq\": \"ok\"\n  },\n  \"env\": {\n    \"nodeEnv\": \"local\",\n    \"nodeVersion\": \"v0.10.37\",\n    \"processName\": \"foobarbazd\",\n    \"pid\": 10329,\n    \"cwd\": \"/Users/example/foobarbaz-server\"\n  },\n  \"git\": {\n    \"commitHash\": \"c5d7c311ac8b5de7e309e18b821225d471c2cf1d\",\n    \"branchName\": \"server-health-integration\",\n    \"tag\": null\n  }\n}\n```\n\n## Usage\n\n### Adding the /health endpoint to a restify server\n\nSee example/server.js for a complete example. Also check the tests for how to use this with hapi and express.\n\n```js\nconst restify = require('restify');\nconst serverHealth = require('server-health');\n\nserverHealth.addConnectionCheck('database', function () {\n  // determine whether database connection is up and functional\n  return true;\n});\nserverHealth.addConnectionCheck('rabbitmq', function () {\n  // determine whether RabbitMQ connection is up and functional\n  return true;\n});\nserverHealth.addConnectionCheck('redis', function () {\n  // determine whether Redis connection is up and functional\n  return true;\n});\nconst server = restify.createServer();\nserverHealth.exposeHealthEndpoint(server);\nserver.listen(8080, function() {\n  console.log('Listening on port 8080');\n});\n```\n\nFor frameworks other than restify (default) specify the used framework:\n\n```js\nconst fastify = require('fastify');\n\nconst server = fastify();\nserverHealth.exposeHealthEndpoint(server, '/health', 'fastify');\nserver.listen({port: 8080}, function() {\n  console.log('Listening on port 8080');\n});\n```\n\n### Querying from the command line\n\nAfter adding the server info health endpoint to a service you can do a quick check\non its status using `curl` and `jq`:\n\n```bash\n\u003e curl -s http://localhost:8080/health | jq '.status'\n\"ok\"\n```\n\n### Filtering the response directly\n\nInstead of filtering the whole response on the client the library also supports\nfiltering server side by specifying a \"filter\" query string parameter.\n\nMultiple properties can be queried by separating them by comma: `filter=status,env.nodeEnv`\n\n```bash\n\u003e curl -s http://localhost:8080/health?filter=status\n{\"status\":\"ok\"}\n```\n\n### Standalone Node Http Health Check Server\n\nFor services that do not have an existing Restify, Express, or Hapi Server, you can create a\nnative Node HTTP Server that only has one route, that also provides the same health\nchecks as Restify, Express, and Hapi servers.\n\n```javascript\nconst serverHealth = require('server-health');\nserverHealth.addConnectionCheck('database', function () {\n  // determine whether database connection is up and functional\n  return true;\n});\nconst options = {\n  endpoint: '/health',  // optional and will default to `/health`\n};\nconst nodeServer = serverHealth.createNodeHttpHealthCheckServer(options);\nnodeServer.listen(8080);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugusthome%2Fserver-health","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faugusthome%2Fserver-health","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugusthome%2Fserver-health/lists"}