From 6867c84defa2b6bb3a7eb7e2cff2be402a8a9777 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 7 Aug 2024 01:44:17 +0200 Subject: Look for the favicon in /static --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0624665..ec164fb 100644 --- a/main.go +++ b/main.go @@ -27,8 +27,10 @@ func main() { port := flag.Int("port", 8080, "port number") flag.Parse() + fs := http.FileServer(http.Dir("static")) mux := http.NewServeMux() - mux.Handle("GET /style.css", http.FileServer(http.Dir("static"))) + mux.Handle("GET /favicon.ico", fs) + mux.Handle("GET /style.css", fs) mux.Handle("GET /", middleware.I18n(http.HandlerFunc(finalHandler))) mux.Handle("POST /language", http.HandlerFunc(setUserLanguage)) -- cgit v1.2.3