@codrjs/health
v1.0.3
Published
Codr health tracker
Downloads
15
Readme
@codrjs/health
Purpose
This repository has a custom-built service health tracker. ServiceHealth is a singleton located at src/index.ts
. This utility is used to hook into kafka events to keep a close eye on what is up and down. This data can then be quickly shared via the getStatus()
command.
If using the @codrjs/kafka
module, then all consumers and producers are already bening listened to. There is no need to manually add them to the service health singleton.
Getting started
Install the package from the npm registry.
yarn add @codrjs/health
Inside the micro-service, you can get the status of all topics and servers with a simple command.
/* Import the health package */
import ServiceHealth from "@codrjs/health";
import { express } from "express";
const app = express();
app.route("/heath", (req, res, next) => {
res.status(200).json(ServiceHealth.getStatus());
});
Todo
- [ ] Add expressjs health data
- [ ] Add tests
Contributing
# Clone the repo
git clone [email protected]:CodrJS/health.git
# Install yarn if you don't have it already
npm install -g yarn
# Install dependencies, build, and test the code
yarn install
yarn build
yarn test