Expand description
A minimal blocking HTTP/1.1 request handler covering the routes the dashboard needs: the static page and two read-only JSON endpoints.
ConstantsΒ§
- HTTP_
METHOD_ πNOT_ ALLOWED - HTTP_
NOT_ πFOUND - HTTP_OK π
- HTTP status codes used by the dashboardβs read-only routes.
- INDEX_
HTML π - The single-page dashboard, embedded so the binary is self-contained.
FunctionsΒ§
- drain_
headers π - Consume the rest of the request headers up to the blank line.
- handle_
connection - Read the request line, route it, and write the response.
- read_
request_ πline - respond π
- Write a complete HTTP/1.1 response and close the connection.
- respond_
json π - route π
- status_
json π - tests_
json π