Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
koa-simple-healthcheck
Advanced tools
simple healthcheck middleware for koa. inspred by express-healthcheck.
npm install koa-simple-healthcheck
app.use(require('koa-simple-healthcheck')());
This will respond with a JSON payload of { "uptime": [uptime in seconds] }
and a 200 status code.
The healthy response can be customised by passing in a custom healthy
method.
app.use(require('koa-simple-healthcheck')({
healthy: function () {
return { everything: 'is ok' };
}
}));
To use a different route, you can set it with a path
property.
app.use(require('koa-simple-healthcheck')({
path: '/ping',
healthy: function () {
return { everything: 'is ok' };
},
}))
You can optionally provide a test method which will be executed to establish the health of the application.
This function can either throw, return an error, or call a callback with an error. Functions with an arity of 0 will expect a return, functions with an arity of 1 will expect a callback.
app.use(require('koa-simple-healthcheck')({
test: function () {
throw new Error('Application is not running');
}
}));
app.use(require('koa-simple-healthcheck')({
test: function () {
return { state: 'unhealthy' };
}
}));
app.use(require('koa-simple-healthcheck')({
test: function (callback) {
callback({ state: 'unhealthy' });
}
}));
FAQs
simple healthcheck middleware for koa
The npm package koa-simple-healthcheck receives a total of 246 weekly downloads. As such, koa-simple-healthcheck popularity was classified as not popular.
We found that koa-simple-healthcheck demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.