Skip to main content

Module http

Module http 

Source
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 πŸ”’