Add favicon

This commit is contained in:
Noah 2022-08-21 17:56:14 -07:00
parent 7f96edf95d
commit c98bc2fb33
3 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package index
import (
"net/http"
"git.kirsle.net/apps/gosocial/pkg/config"
"git.kirsle.net/apps/gosocial/pkg/log"
"git.kirsle.net/apps/gosocial/pkg/templates"
)
@ -23,3 +24,10 @@ func Create() http.HandlerFunc {
}
})
}
// Favicon
func Favicon() http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, config.StaticPath+"/favicon.ico")
})
}

View File

@ -21,6 +21,7 @@ func New() http.Handler {
// Register controller endpoints.
mux.HandleFunc("/", index.Create())
mux.HandleFunc("/favicon.ico", index.Favicon())
mux.HandleFunc("/about", index.About())
mux.HandleFunc("/faq", index.FAQ())
mux.HandleFunc("/tos", index.TOS())

BIN
web/static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB