Merge pull request 'Added /auth/refresh route' (#10) from dev into main
This commit was merged in pull request #10.
This commit is contained in:
@@ -32,14 +32,15 @@ func NewMux(cfg Config) http.Handler {
|
|||||||
|
|
||||||
apiMux := http.NewServeMux()
|
apiMux := http.NewServeMux()
|
||||||
apiMux.HandleFunc("/", handler.DefaultHandler)
|
apiMux.HandleFunc("/", handler.DefaultHandler)
|
||||||
|
apiMux.HandleFunc("GET /health", handler.HealthHandler)
|
||||||
apiMux.HandleFunc("POST /login", authHandler.Login)
|
apiMux.HandleFunc("POST /login", authHandler.Login)
|
||||||
|
apiMux.HandleFunc("POST /auth/refresh", authHandler.Refresh)
|
||||||
|
|
||||||
apiMux.Handle("POST /users", protected(userHandler.CreateUser))
|
apiMux.Handle("POST /users", protected(userHandler.CreateUser))
|
||||||
|
|
||||||
apiMux.Handle("POST /lists", protected(listHandler.CreateList))
|
apiMux.Handle("POST /lists", protected(listHandler.CreateList))
|
||||||
|
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.HandleFunc("GET /health", handler.HealthHandler)
|
|
||||||
mux.Handle("/api/v1/", http.StripPrefix("/api/v1", apiMux))
|
mux.Handle("/api/v1/", http.StripPrefix("/api/v1", apiMux))
|
||||||
|
|
||||||
var httpHandler http.Handler = mux
|
var httpHandler http.Handler = mux
|
||||||
|
|||||||
Reference in New Issue
Block a user