summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.go b/main.go
index 3e2cd86..b5ff613 100644
--- a/main.go
+++ b/main.go
@@ -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 {