Skip to content

Latest commit

 

History

History
104 lines (70 loc) · 2.56 KB

README.md

File metadata and controls

104 lines (70 loc) · 2.56 KB

HealthCheck

Latest Version on Packagist Software License Total Downloads

HealthCheck provides your Laravel application with a /healthcheck endpoint to make it easier nice and easy to view the status of your application.

Install

supports package auto discovery for Laravel

Via Composer

$ composer require io-digital/health-check

Add the ServiceProvider to your config/app.php providers array:

IoDigital\HealthCheck\HealthCheckServiceProvider::class,

Then run the following command artisan command:

$ php artisan vendor:publish --provider="IoDigital\HealthCheck\HealthCheckServiceProvider" 

This will publish the package config file to config/healthcheck.php.

You currently have the options to select which tests to perform:

'ssl' => true,
'database' => true,
'application' => true,

//System information
'memory' => false,
'cpu_usage' => false,

Usage

The package automatically adds the /healthcheck endpoint to your application. All you need to do is hit that route.

For now the endpoint returns the following:

  • 200 reponse
  • JSON object with the following layout:
{
    "application": {
        "message": "Application is running",
        "success": true
    },
    "database": {
        "message": "There was an error connecting to the database. Error has been logged.",
        "success": false
    },
    "ssl": {
        "message": "SSL is working.",
        "success": true 
    }
}

Future releases will hope to expand on what is tested.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.