# server-status-utils

> An internal status page for Express servers.

Latest version **1.0.2** (published 2019-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install server-status-utils
pnpm add server-status-utils
yarn add server-status-utils
bun add server-status-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-06-14 |
| First published | 2019-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.14.0 |
| Dependencies | 3 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | James Bursa |
| Maintainers | nava |

## Links

- npm: https://www.npmjs.com/package/server-status-utils
- Repository: https://github.com/navapbc/server-status-utils
- Issues: https://github.com/navapbc/server-status-utils/issues
- npm.io page: https://npm.io/package/server-status-utils

## Dependencies (3)

- [ipaddr.js](https://npm.io/package/ipaddr.js.md) 1.9.0
- [sprintf-js](https://npm.io/package/sprintf-js.md) 1.1.2
- [underscore.string](https://npm.io/package/underscore.string.md) 3.3.5

## Recent versions

- 1.0.2 (latest) — 2019-06-14
- 1.0.1 — 2019-06-06
- 1.0.0 — 2019-01-25

## README

# Server status utilities

This module provides an internal status page for Express based servers. The
status page is aimed for developers and shows useful info for diagnostics or
troubleshooting, for example the application version and recent requests.

See an [example of the status page](http://htmlpreview.github.io/?https://github.com/navapbc/server-status-utils/blob/master/example/example_status.html).

## Usage

To use, first require the module and create a ServerStatus object:

```javascript
const serverStatus = require("server-status-utils")
const ss = new serverStatus.ServerStatus()
```

Connect the collectRequestStats handler to track all requests (before all other handlers that may
respond to a request). It is safest to put this as the first handler:

```javascript
app.use("/", ss.collectRequestStats.bind(ss))
```

Connect the statusPage handler to a specific GET path of your choice. This can be done at any
point in your express handlers:

```javascript
app.get("/status", ss.statusPage.bind(ss))
```

A usage example is [included](example/example_server.js). To run the example use npm:

```
npm install
npm run example
```

## Tests

To run the test suite use npm:

```
npm install
npm test
```

A coverage report will be produced in the `coverage` directory.

---
_Source: https://npm.io/package/server-status-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
