StockManager exposes a single lightweight health check endpoint that returns an immediateDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/InnoDev69/StockManager/llms.txt
Use this file to discover all available pages before exploring further.
200 OK with a JSON body as soon as the server is accepting connections. It requires no authentication, makes no database queries, and carries no side effects — making it safe to call as frequently as a monitoring or orchestration system requires.
GET /api/health
Authentication: None required Request body: None Query parameters: NoneResponse
| Field | Type | Value |
|---|---|---|
status | string | Always "Ok" when the server is reachable |
Example
How StockManager uses this endpoint internally
When StockManager is launched as a desktop application,main.py starts the Waitress WSGI server on a background daemon thread and then calls wait_for_server() before opening the PyWebView window. That function attempts a raw TCP connection to 127.0.0.1:5000 in a tight loop and returns as soon as the port is reachable — or raises a RuntimeError after 15 seconds if the server never responds.
boot:server_ready with the elapsed milliseconds and the PyWebView window is created. This guarantees the UI never loads against a server that is still initialising.
Practical uses
Uptime monitoring
Point any HTTP-based uptime monitor (e.g. healthchecks.io, UptimeRobot, Grafana OnCall) atGET /api/health. A non-200 response or a connection timeout indicates the server process has stopped or become unresponsive.
Docker HEALTHCHECK
Add aHEALTHCHECK instruction to your Dockerfile so the container runtime can detect and restart an unhealthy StockManager instance automatically:
| Option | Value | Meaning |
|---|---|---|
--interval | 30s | Check every 30 seconds |
--timeout | 5s | Mark unhealthy if no reply within 5 seconds |
--start-period | 10s | Give the container 10 seconds to initialise before failures count |
CI/CD readiness gate
In a CI pipeline that spins up StockManager before running integration tests, poll this endpoint rather than using a fixedsleep: