Download the PHP package tourze/psr15-health-check-request-handler without Composer
On this page you can find all versions of the php package tourze/psr15-health-check-request-handler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tourze/psr15-health-check-request-handler
More information about tourze/psr15-health-check-request-handler
Files in tourze/psr15-health-check-request-handler
Package psr15-health-check-request-handler
Short Description PSR-15 Health Check Request Handler
License MIT
Informations about the package psr15-health-check-request-handler
PSR-15 Health Check Request Handler
中文
A simple and lightweight PSR-15 Request Handler for health check endpoints, designed for easy integration into any HTTP service or middleware pipeline.
Features
- Implements PSR-15
RequestHandlerInterface - Provides a basic health check endpoint, returning HTTP 200 with a customizable response
- Supports custom health check paths
- Customizable response body for healthy status
- Returns HTTP 404 for non-health-check paths
Installation
Requirements:
- PHP >= 8.1
psr/http-message,psr/http-server-handler,nyholm/psr7
Install via Composer:
Quick Start
Basic Usage
Default Behavior
By default, the handler responds with status 200 and body ok for the following paths:
/health/health.php/health.html/health.asp
All other paths will receive a 404 Not Found response.
Customization
You can customize the health check paths and healthy response text (using reflection):
Documentation
- PSR-15: HTTP Server Request Handlers
- The handler only checks the request path and does not implement any advanced health logic.
Contributing
- Issues and pull requests are welcome.
- Please follow PSR coding standards.
- Run tests with PHPUnit before submitting PRs.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Changelog
See Releases for version history and upgrade notes.
All versions of psr15-health-check-request-handler with dependencies
psr/http-message Version ^1.1 || ^2.0
psr/http-server-handler Version ^1.0
nyholm/psr7 Version ^1.8.2