Essential session storage is required to sign in. Optional analytics remain off unless you allow them.
Build a small REST API using only net/http (no web framework): a couple of resources with handlers, routing via http.ServeMux, JSON encode/decode with struct tags, a logging middleware (a handler wrapping another), proper status codes, and graceful shutdown on SIGINT/SIGTERM. Cover the handlers with table-driven tests using net/http/httptest.
Handlers + ServeMux used idiomatically; a middleware wraps handlers; correct status codes and JSON.
Table-driven handler tests with httptest covering success and error cases.
Graceful shutdown (http.Server.Shutdown on signal); request errors handled, not panicking the server.
gofmt-clean; errors as values; no global mutable state without protection.
Use this README structure to make the work reviewable.
DevPath fetches a read-only, size-capped snapshot. Submitted code is never executed.
# A JSON HTTP API with the standard library ## Goal Build a small REST API using only net/http (no web framework): a couple of resources with handlers, routing via http.ServeMux, JSON encode/decode with struct tags, a logging middleware (a handler wrapping another), proper status codes, and graceful shutdown on SIGINT/SIGTERM. Cover the handlers with table-driven tests using net/http/httptest. ## Acceptance criteria - [ ] net/http design: Handlers + ServeMux used idiomatically; a middleware wraps handlers; correct status codes and JSON. - [ ] Tests: Table-driven handler tests with httptest covering success and error cases. - [ ] Robustness: Graceful shutdown (http.Server.Shutdown on signal); request errors handled, not panicking the server. - [ ] Idiomatic Go: gofmt-clean; errors as values; no global mutable state without protection. ## Verification - [ ] Document installation and run commands. - [ ] Record automated checks and their exact commands. - [ ] Add representative output, screenshots, or a short demo where useful. - [ ] Confirm failure paths and known constraints. ## Decision log ### Decision title - Context: - Choice: - Alternatives considered: - Tradeoffs: ## Evidence - Link each rubric criterion to the file, test, or artifact that demonstrates it. ## Known limitations - List what is intentionally out of scope and what should be improved next.