mirror of
https://github.com/static-web-server/static-web-server.git
synced 2026-01-25 05:06:33 +00:00
* Fix anchor links in documentation * Move strict to mkdocs config * add mkdocs to CI --------- Co-authored-by: Jose Quintana <1700322+joseluisq@users.noreply.github.com>
988 B
988 B
Health endpoint
SWS provides an optional /health endpoint that can be used to check if it is running properly.
When the /health is requested, SWS will generate a log only at the debug level instead of the usual info level for a regular file.
The HTTP methods supported are GET and HEAD.
This feature is disabled by default and can be controlled by the boolean --health option or the equivalent SERVER_HEALTH env.
Usage with Kubernetes liveness probe
The health endpoint is well suited for the Kubernetes liveness probe:
apiVersion: v1
kind: Pod
metadata:
name: frontend
spec:
containers:
- name: sws
image: frontend:1.0.0
command:
- static-web-server
- --root=/public
- --log-level=info
- --health
ports:
- containerPort: 80
name: http
livenessProbe:
httpGet:
path: /health
port: http