mammatus / healthz-vhost
⚕️ Basic health check vhost
Package info
github.com/MammatusPHP/healthz-vhost
Language:Makefile
pkg:composer/mammatus/healthz-vhost
Requires
- php: ^8.4
- mammatus/groups: ^0.1.1 || ^0.2.0 || ^0.3.0 || ^0.4.0
- mammatus/http-server-attributes: ^0.1.0 || ^0.2.0 || ^0.3.0
- mammatus/http-server-contracts: ^0.1.0
- mammatus/http-server-webroot: ^0.1.2
- mammatus/life-cycle-events: ^2.3.0
- psr/http-message: ^1.1.0
- react/event-loop: ^1.3.0
- react/http: ^1.8.0
Requires (Dev)
- mammatus/app: dev-master
- wyrihaximus/makefiles: ^0.15.1
- wyrihaximus/test-utilities: ^14.4.0
- wyrihaximus/ticking-promise: ^3.1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-04 16:24:03 UTC
README
Ready-made Vhost configuration, HTTP handlers, and Kubernetes-style probes for a dedicated healthz virtual host. Install it in a MammatusPHP application that uses mammatus/http-server; the server Composer plugin discovers this package (via extra.mammatus.http.server.has-vhosts) and wires routes, Helm probe paths, and static file serving from public/.
The vhost listens on port 9666 and registers the Mammatus group healthz (Type::Daemon).
Install
To install via Composer, use the command below. Composer picks the latest compatible version and applies a ^ constraint.
composer require mammatus/healthz-vhost
Your application also needs mammatus/http-server (or another stack that consumes the same attributes and Vhost contract). This package does not start an HTTP server by itself.
Routes
All handlers belong to vhost healthz (Vhost attribute). Each exposes a static handle() method marked @api so static analysis treats it as an entrypoint for routing.
| HTTP method | Path | Handler | Purpose |
|---|---|---|---|
GET |
/ |
IndexHandler |
Redirects to /index.html |
GET |
/healthz |
HealthzHandler |
JSON health payload |
GET |
/probe/liveness |
LivenessProbeHandler |
Liveness probe (ProbeType::Liveness) |
GET |
/probe/readiness |
ReadinessProbeHandler |
Readiness probe |
GET |
/probe/startup |
StartUpProbeHandler |
Startup probe |
Successful health and probe handlers respond with 200, Content-Type: application/json, and body {"result":"healthy"}.
More attribute reference: mammatus/http-server-attributes.
License
The MIT License (MIT)
Copyright (c) 2026 Cees-Jan Kiewiet
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.