Adding favicon

This commit is contained in:
collin 2025-08-27 18:13:06 +02:00
parent 6a455a314f
commit 57a3bc4ecd
No known key found for this signature in database
2 changed files with 3 additions and 0 deletions

BIN
client/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -155,6 +155,9 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
fmt.Printf("%s - [%s] (%s) %s\n", time.Now().Format(time.RFC3339), r.RemoteAddr, r.Method, r.URL) fmt.Printf("%s - [%s] (%s) %s\n", time.Now().Format(time.RFC3339), r.RemoteAddr, r.Method, r.URL)
switch true { switch true {
case r.Method == "GET" && r.URL.Path == "/favicon.ico":
getStaticFile("./client/favicon.ico", "image/png", w)
case r.Method == "GET" && r.URL.Path == "/": case r.Method == "GET" && r.URL.Path == "/":
getStaticFile("./client/index.html", "text/html", w) getStaticFile("./client/index.html", "text/html", w)