https://github.com/includable/express-middleware-health
Health endpoint and metrics middleware.
https://github.com/includable/express-middleware-health
Last synced: 3 months ago
JSON representation
Health endpoint and metrics middleware.
- Host: GitHub
- URL: https://github.com/includable/express-middleware-health
- Owner: includable
- Created: 2018-12-28T21:37:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-06T11:23:35.000Z (about 7 years ago)
- Last Synced: 2025-03-14T21:38:19.146Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# middleware-health
This package adds a `/health` endpoint that can be used for status checks and lists some request metrics:
```json
{
"status": 200,
"friendlyName": "OK",
"environment": "production",
"uptime": 80374,
"requests": 208,
"responseTime": 0.001
}
```
## Installation
```sh
npm i @includable/middleware-health
```
## Usage
```js
const express = require('express')
const health = require('@includable/middleware-health')
app.use(health())
app.listen(process.env.PORT || 3000, () => console.log(`Example app running.`))
```