Wondering what’s next for npm?Check out our public roadmap! »

    @restorecommerce/koa-health-check
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.3 • Public • Published

    Koa Health Check

    VersionBuild StatusDependenciesCoverage Status

    Cloud Health Connect provides a Koa Middleware based on Cloud Health. The following endpoints are provided to monitor services and applications on Kubernetes:

    • Health Endpoint
    • Liveness Endpoint
    • Readiness Endpoint

    Usage

    import * as Koa from 'koa';
    import * as health from '@cloudnative/health';
    import { HealthEndpoint, ReadinessEndpoint, LivenessEndpoint } from 'koa-health-check';
     
    const healthcheck = new health.HealthChecker();
    const koa = new Koa();
     
    koa.all('/live', LivenessEndpoint(healthcheck));
    koa.all('/ready', ReadinessEndpoint(healthcheck));
    koa.all('/health', HealthEndpoint(healthcheck));

    Status Responses

    Cloud Health Status Readiness Status Code Liveness Status Code Combined Health Status Code
    STARTING 503 UNAVAILABLE 200 OK 503 UNAVAILABLE
    UP 200 OK 200 OK 200 OK
    DOWN 503 UNAVAILABLE 503 UNAVAILABLE 503 UNAVAILABLE
    STOPPING 503 UNAVAILABLE 503 UNAVAILABLE 503 UNAVAILABLE
    STOPPED 503 UNAVAILABLE 503 UNAVAILABLE 503 UNAVAILABLE
    - 500 SERVER ERROR 500 SERVER ERROR 500 SERVER ERROR

    Development

    To build the library, use npm run build command.

    To run the tests, use npm run test command.

    Install

    npm i @restorecommerce/koa-health-check

    DownloadsWeekly Downloads

    127

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    13.7 kB

    Total Files

    12

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar