Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@hmcts/nodejs-healthcheck
Advanced tools
A library for adding reform standard compliant healthchecks to nodejs applications.
It exposes 3 endpoints:
/health
- Returns 200 by default along with buildInfo
, can optionally include result evaluating all checks
passed in config./health/liveness
- Returns 200 always./health/readiness
- Returns 200 by default , can optionally include result evaluating all readinessChecks
passed in config.Configure an express.js handler with checks.
const config = {
checks: {
mySimpleWebCheck: healthcheck.web("https://example.com/status"),
myComplexWebCheck: healthcheck.web("https://example.com/other", {
callback: (err, res) => {
return res.body.status == "good" ? healthcheck.up() : healthcheck.down()
},
timeout: 5000,
deadline: 10000,
}),
myRawCheck: healthcheck.raw(() => {
return myInternalCheck() ? healthcheck.up() : healthcheck.down()
})
},
buildInfo: {
myCustomBuildInfo: "yay"
}
};
healthcheck.addTo(app, config);
You can optionally include readiness checks.
const config = {
checks: {
mySimpleWebCheck: healthcheck.web("https://example.com/status"),
myComplexWebCheck: healthcheck.web("https://example.com/other", {
callback: (err, res) => {
return res.body.status == "good" ? healthcheck.up() : healthcheck.down()
},
timeout: 5000,
deadline: 10000,
}),
myRawCheck: healthcheck.raw(() => {
return myInternalCheck() ? healthcheck.up() : healthcheck.down()
})
},
readinessChecks: {
mySimpleWebCheck: healthcheck.web("https://example.com/status")
},
buildInfo: {
myCustomBuildInfo: "yay"
}
};
healthcheck.addTo(app, config);
Based on above, you should include a dependency into readiness checks only if they are exclusive/hard dependencies for your service. Unavailability of soft dependencies needs to be handled in code to give appropriate customer experience.
Good example for check to be included in readiness:
Redis
or Elastic Search
which are exclusive to the application (not shared).Bad example for check to be included in readiness:
Bump the version (SemVer) and create a release in the GitHub UI, Travis CI will then build test and release to the npm registry.
Run yarn install (if packages not downloaded) and then run yarn test to run unit tests
FAQs
Healthcheck endpoint for Reform nodejs applications
The npm package @hmcts/nodejs-healthcheck receives a total of 4,504 weekly downloads. As such, @hmcts/nodejs-healthcheck popularity was classified as popular.
We found that @hmcts/nodejs-healthcheck demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 16 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.