diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -18,6 +18,9 @@ import ( //go:embed templates var tmplFS embed.FS +//go:embed favicon.ico +var favicon []byte + type BoxHandler struct { dataPath string @@ -38,6 +41,10 @@ func serve(w http.ResponseWriter, token string, views ...string) { func (handler BoxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodGet: + if r.URL.Path == "/favicon.ico" { + w.Write(favicon) + return + } if r.URL.Path == "/" { serve(w, handler.token, "templates/index.html") } else { |
