engineering notes
Application routes
The route layer stays deliberately small so the project can prove its transport and parsing behavior without hiding behind application complexity.
Why the route surface is small
Routing lives in src/routes.ts. The server exposes only four endpoints: GET /, GET /health, GET /about, and POST /echo. That is enough to test metadata responses, status probes, owner data, and request-body handling.
A small route surface is useful here because it keeps the project honest. If one endpoint fails, the reason is usually obvious: transport, parser, or route logic.
Endpoint contracts
GET / returns project-level metadata and supported routes. GET /health is a lightweight health probe. GET /about returns owner information. POST /echo returns the submitted body using the incoming content type when one exists.
Unsupported methods on /echo return 405 with an Allow header. Unknown paths return 404 with a small JSON payload describing the failure.
Response framing
The route handler returns plain response objects, not framework response classes. serializeHttpResponse() converts that object into the final HTTP frame by computing content length, injecting the server header, and writing Connection: close.
That keeps the application layer readable. Route logic chooses status, headers, and body. The serializer handles the wire format.