Refactor router setup to split routes by auth/protected boundary

This commit is contained in:
2026-04-27 23:30:17 +08:00
parent 7fb125ea87
commit d4d7495ffb
5 changed files with 31 additions and 19 deletions

View File

@@ -75,5 +75,5 @@ Applied to protected groups: auth (JWT validation, inject user into gin.Context)
- `cmd/serve.go` loads config, creates `app.WebApp`, builds the router, and starts the HTTP server.
- `app.WebApp` carries runtime dependencies and build metadata needed to assemble handlers.
- `internal/server` owns Gin router setup, `/api/v1` route groups, and HTTP server lifecycle.
- `internal/server` owns Gin router setup (`router.go`), route registration split into `routes_public.go` and `routes_protected.go`, and HTTP server lifecycle.
- `RunWithGracefulShutdown` stops accepting new requests on termination and gives in-flight requests time to finish.