Capstone 3, an HTTP service
The third project is the task manager as an HTTP service: routes, a store interface with two implementations, a handler per route, a request id and a log line from middleware, tests with httptest, the built frontend embedded in the binary, and a deploy with a health check and a graceful shutdown.
129
Capstone 3: the API and its layout
the routes, the JSON shapes and the packages that own each part
Open
130
Capstone 3: the store
a store interface, an in-memory implementation and one backed by the file from the CLI capstone
Open
131
Capstone 3: the handlers
a handler per route, decoding, validation and the status code for each answer
Open
132
Capstone 3: middleware and logging
a request id, a slog line per request, recovery and the middleware chain
Open
133
Capstone 3: httptest and a fake store
a handler tested with httptest, a fake store and a table of requests and statuses
Open
134
Capstone 3: the built frontend
an embedded build folder, a file server and the fallback to index.html
Open
135
Capstone 3: deploy and shutdown
a Docker image, the environment it reads, a graceful shutdown and a health check
Open