Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.07 KB

File metadata and controls

45 lines (31 loc) · 1.07 KB

Database | Jitar Plugins

This package provides plugins for integrating the The Shelf database package in Jitar applications.

It contains a single health check for checking the database health.

Installation

npm install @theshelf/database @jitar-plugins/database

Usage

Follow the following steps to configure and use the provided health check.

Step 1 - Configure the health check

// src/health/databaseHealthCheck.ts

import database from '@theshelf/database';
import { DatabaseHealthCheck } from '@jitar-plugins/database';

export default new DatabaseHealthCheck(database);

Step 2 - Activate the health check

With the health check in place, it needs to be activated by registering it to the worker / standalone service.

/* services/some-worker.json */
{
    "url": "http://example.com:3000",
    "healthChecks": [ /* add health checks here */
        "./health/databaseHealthCheck"
    ],
    "worker":
    {
        /* service configuration */
    }
}