add message for disabled static
This commit is contained in:
@@ -49,8 +49,15 @@ func (r *Router) RouteHandler() chi.Router {
|
|||||||
r.r.Handle("/static/*", http.StripPrefix("/static/", fs))
|
r.r.Handle("/static/*", http.StripPrefix("/static/", fs))
|
||||||
} else {
|
} else {
|
||||||
slog.Info("Static file serving is disabled")
|
slog.Info("Static file serving is disabled")
|
||||||
|
r.r.Get("/", func(w http.ResponseWriter, req *http.Request) {
|
||||||
|
http.Error(w, "Static serving is disabled", http.StatusForbidden)
|
||||||
|
})
|
||||||
|
r.r.HandleFunc("/static/*", func(w http.ResponseWriter, req *http.Request) {
|
||||||
|
http.Error(w, "Static serving is disabled", http.StatusForbidden)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
r.r.Route("/api", func(api chi.Router) {
|
r.r.Route("/api", func(api chi.Router) {
|
||||||
api.Route("/block", block.Route(r.cfg))
|
api.Route("/block", block.Route(r.cfg))
|
||||||
api.Route("/auth", auth.Route(r.cfg))
|
api.Route("/auth", auth.Route(r.cfg))
|
||||||
|
|||||||
Reference in New Issue
Block a user