Add httpserver package: TLS HTTP server with chi

- Server wrapping chi.Mux + http.Server with TLS 1.3 minimum
- ListenAndServeTLS and graceful Shutdown
- LoggingMiddleware (method, path, status, duration, remote)
- StatusWriter for status code capture in middleware
- WriteJSON and WriteError helpers
- 8 tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 16:27:59 -07:00
parent 9e98eb0a21
commit 1be01ef438
4 changed files with 275 additions and 0 deletions

1
go.mod
View File

@@ -3,6 +3,7 @@ module git.wntrmute.dev/kyle/mcdsl
go 1.25.7
require (
github.com/go-chi/chi/v5 v5.2.5
github.com/pelletier/go-toml/v2 v2.3.0
modernc.org/sqlite v1.47.0
)