
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
healthpoint
Advanced tools
Easily expose your http server's health.
var http = require('http')
var healthpoint = require('healthpoint')
var hp = healthpoint({
version: require('./package.json').version
}, function (cb) {
// ordinarily you chould check your db connection
// instead we'll just alternate between healthy and fail every 5 seconds
var isOk = Math.round(Date.now() / 5000) % 2
cb(isOk ? null : new Error('Having a bad time...'))
})
http.createServer(function (req, res) {
if (req.url === '/health') return hp(req, res)
res.end('Visit /health for the health check')
}).listen(1337)
console.log('Visit http://localhost:1337/health for the health check')
healthpoint()
will return an http request handler function. healthpoint()
takes up to two optional arguments, properties
and check
.
Any key/value pairs on properties
will be exposed on the health check JSON. This is useful for adding things like your app's version.
check
is a function that will be called with a callback. If the callback is called with an error as its argument, the health check JSON will have a 500 statusCode and will display status: 'Error'
.
MIT
FAQs
Easily expose your http server's health.
The npm package healthpoint receives a total of 16,174 weekly downloads. As such, healthpoint popularity was classified as popular.
We found that healthpoint 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.