Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 743 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 743 Bytes

Introduction

This is a lightweight lib for creating health checks in php.

<?php

use Jtl\HealthCheck\AbstractHealthCheck;
use Jtl\HealthCheck\Result;
use Jtl\HealthCheck\ResultDetail;
use Jtl\HealthCheck\ResultMessage;

$healthCheck = new class extends AbstractHealthCheck {
    public function check(): Result
    {
        $passed = true;

        $details = [
            new ResultDetail('app', true),
            new ResultDetail('db', true),
        ];

        $messages =  [
            new ResultMessage('info', 'app', 'Everything is tutti')
        ];

        return new Result($passed, $details, $messages);
    }
};

//Outputs a json response with either http status 200 or 500.
$healthCheck->checkAndSendResult();