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.

12.1 Capstone 3: the API and its layout the routes, the JSON shapes and the packages that own each part Open 12.2 Capstone 3: the store a store interface, an in-memory implementation and one backed by the file from the CLI capstone Open 12.3 Capstone 3: the handlers a handler per route, decoding, validation and the status code for each answer Open 12.4 Capstone 3: middleware and logging a request id, a slog line per request, recovery and the middleware chain Open 12.5 Capstone 3: httptest and a fake store a handler tested with httptest, a fake store and a table of requests and statuses Open 12.6 Capstone 3: the built frontend an embedded build folder, a file server and the fallback to index.html Open 12.7 Capstone 3: deploy and shutdown a Docker image, the environment it reads, a graceful shutdown and a health check Open

Lessons