express-service-health

1.0.1 • Public • Published

express-service-health

express middleware to provide a simple health check endpoint for a service


Build StatusCoverage StatusISC LicenseNodeJS

JavaScript Style Guide

api

const health = require('express-service-health')

health(express.Router[, endpoint])

health is the default value for the endpoint

example

const health = require('express-service-health')
const express = require('express')
 
const service = express()
 
const router = express.Router()
 
router.get(
    '/hello-world',
    (req, res) => { res.send('hello world') }
)
 
service.use(serviceHealth(express.Router))
service.use('/', router)
 
request('some uri')
  .get('/health')
  .end((err, res) => {
    // err
    // res.statusCode or res.status = 200
    // res.body = { uptime: `uptime value` }
  })

ISC License (ISC)

Readme

Keywords

Package Sidebar

Install

npm i express-service-health

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • quim