feat: added swaggo support

This commit is contained in:
Robin Dittmar
2026-07-28 14:41:49 +02:00
parent cb14374d09
commit 2e1fbc6e68
7 changed files with 80 additions and 6 deletions
+9 -6
View File
@@ -30,14 +30,17 @@ func NewMux(cfg Config) http.Handler {
protected := middleware.WithJWT(authService)
apiMux := http.NewServeMux()
apiMux.HandleFunc("/", handler.DefaultHandler)
apiMux.HandleFunc("POST /login", authHandler.Login)
apiMux.Handle("POST /users", protected(userHandler.CreateUser))
apiMux.Handle("POST /lists", protected(listHandler.CreateList))
mux := http.NewServeMux()
mux.HandleFunc("/", handler.DefaultHandler)
mux.HandleFunc("GET /health", handler.HealthHandler)
mux.HandleFunc("POST /login", authHandler.Login)
mux.Handle("POST /users", protected(userHandler.CreateUser))
mux.Handle("POST /lists", protected(listHandler.CreateList))
mux.Handle("/api/v1/", http.StripPrefix("/api/v1", apiMux))
var httpHandler http.Handler = mux
httpHandler = middleware.WithMaxBytes(1024 * 64)(httpHandler)