feat: added swaggo support
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user