Skip to content

Instantly share code, notes, and snippets.

@twolfson
Created September 27, 2012 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twolfson/3792062 to your computer and use it in GitHub Desktop.
Save twolfson/3792062 to your computer and use it in GitHub Desktop.
Health for your server
// Health page (attribution to dshaw)
var pkg = require('./package.json');
version = pkg.version;
app.get('/health', function (req, res) {
var health = {
'version': pkg.version,
'pid': process.pid,
'memory': process.memoryUsage(),
'uptime': process.uptime()
};
res.send(health);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment