add
This commit is contained in:
@@ -89,5 +89,5 @@ func (h *Handler) Root(w http.ResponseWriter, r *http.Request) {
|
||||
httpx.MethodNotAllowed(w, string(codes.MethodNotAllowed))
|
||||
return
|
||||
}
|
||||
httpx.OK(w, map[string]string{"service": "user"})
|
||||
httpx.OK(w, map[string]string{"service": "user", "user_id": httpx.UserID(r)})
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package router
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"common/httpx"
|
||||
"user/internal/handler"
|
||||
)
|
||||
|
||||
@@ -10,7 +11,7 @@ func New(h *handler.Handler) http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/healthz", h.Healthz)
|
||||
mux.HandleFunc("/version", h.Version)
|
||||
mux.HandleFunc("/", h.Root)
|
||||
mux.Handle("/", httpx.AuthRequired()(http.HandlerFunc(h.Root)))
|
||||
mux.HandleFunc("/register", h.Register)
|
||||
mux.HandleFunc("/login", h.Login)
|
||||
return mux
|
||||
|
||||
Reference in New Issue
Block a user