express-actuator-endpoints

This module is an express middleware that exposes endpoints that somewhat mimic the behavior of [Spring Boot Actuator](https://github.com/spring-projects/spring-boot/tree/master/spring-boot-project/spring-boot-actuator)

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
express-actuator-endpoints
0.2.16 years ago6 years agoMinified + gzip package size for express-actuator-endpoints in KB

Readme

Express Actuator Endpoints
This module is an express middleware that exposes endpoints that somewhat mimic the behavior of Spring Boot Actuator
All responses are in JSON format.

Installation

npm i --S express-actuator-endpoints

Usage

import express from "express";
import actuator from "express-actuator-endpoints";

const app = express();
app.use(actuator());

Endpoints

| Endpoint | Response | | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | /health | Responds with a status of "UP" and a default description | | /info | Responds with the last git commit info when used in conjunction with node-git-info-json | | /env | Responds with process.env |

Configuration

You can pass a configuration object to this middleware and the routes will serve any information you pass, along with the defaults. See example below:
import express from "express";
import actuator from "express-actuator-endpoints";

const actuatorConfig = {
  info: {
    gitInfo: "Some git info"
  },
  health: {
    description: "Jim's API"
  }
};

const app = express();
app.use(actuator(actuatorConfig));