How petarivanov01/odin-http-from-scratch works
This is a small HTTP/1.1 server whose main workflow accepts a connection, receives and parses one request, dispatches by method and path, runs a handler, builds a response, sends it, and closes the connection. The README documents worker-pool execution for parsing through response building, while socket I/O stays on the I/O thread. Source excerpts were unavailable, so relationships below rely on the README; module responsibilities are inferred only where the file tree and documented capabilities support them.
Main entry points: main.odin Worker pool · read.odin Connection I/O · parse.odin Request parser · router.odin Method-path router
Components 11
Server runtime
- Server entry
main.odin - Connection I/O
http/read.odin - Worker pool
main.odin
HTTP processing
- Request parser
http/parse.odin - HTTP types
http/types.odin - Method-path router
http/router.odin - Response builder
http/response.odin - HTTP errors
http/errors.odin
Route handlers
- Ping routes
routes/ping.odin
Other components
- HTTP client
- Nonblocking I/O
Connections 14
- HTTP client → Server entry: sends request
README.md - Server entry → Nonblocking I/O: uses I/O
README.md - Server entry → Connection I/O: accepts connections
README.md - Connection I/O → HTTP client: receives bytes
README.md - Connection I/O → HTTP client: sends bytes
README.md - Server entry → Worker pool: dispatches work
README.md - Worker pool → Request parser: parses request
README.md - Worker pool → Method-path router: finds route
README.md - Worker pool → Ping routes: runs handler
README.md - Worker pool → Response builder: builds response
README.md - Request parser → HTTP types: produces request
README.md - Method-path router → Ping routes: dispatches by method and path
README.md - Response builder → HTTP types: sets response fields
README.md - HTTP errors → HTTP client: reports failure status
README.md