We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7777d15 commit 9cc8524Copy full SHA for 9cc8524
server/router/router.go
@@ -17,8 +17,12 @@ func New(logger *slog.Logger, database db.Database) http.Handler {
17
18
mux := http.NewServeMux()
19
20
- mux.Handle("/assets/", middleware.CacheMiddleware(http.FileServer(http.FS(dist.AssetsDir))))
21
- mux.HandleFunc("/", h.Home)
+ mux.Handle(newPath(http.MethodGet, "/assets/"), middleware.CacheMiddleware(http.FileServer(http.FS(dist.AssetsDir))))
+ mux.HandleFunc(newPath(http.MethodGet, "/"), h.Home)
22
23
return middleware.NewLoggingMiddleware(logger, mux)
24
}
25
+
26
+func newPath(method string, path string) string {
27
+ return method + " " + path
28
+}
0 commit comments