summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-08-07 01:44:17 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-08-07 01:44:17 +0200
commit6867c84defa2b6bb3a7eb7e2cff2be402a8a9777 (patch)
tree6ac54950a66d5eb58a89b8a081509826b8df73d2
parent351c15d28e0444fd8a78c510a0c4d62ed433c758 (diff)
Look for the favicon in /static
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
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))