Skip to content

Commit

Permalink
feat: add a favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
masl committed Nov 5, 2023
1 parent b6fa961 commit 1810f4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file added static/favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions web/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ func GetRouter(store storage.Store, htmlTemplates *template.Template, staticFS f
// static files
router.Handler("GET", "/static/*filepath", http.FileServer(http.FS(staticFS)))

// redirect /favicon.ico to /static/favicon.ico
router.GET("/favicon.ico", func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
http.Redirect(w, r, "/static/favicon.ico", http.StatusMovedPermanently)
})

// api endpoints
router.POST("/api/ping", ping.Handle())

Expand Down

0 comments on commit 1810f4a

Please sign in to comment.