1
0

Added /favicon.svg endpoint.

This commit is contained in:
Alexander Andreev 2023-05-21 20:13:15 +04:00
parent ac92fe7d0b
commit d7191d0fbd
Signed by: Arav
GPG Key ID: D22A817D95815393
2 changed files with 6 additions and 0 deletions

View File

@ -85,6 +85,7 @@ func main() {
srv.SetNotFoundHandler(http.NotFound) srv.SetNotFoundHandler(http.NotFound)
srv.GET("/robots.txt", http.RobotsTxt) srv.GET("/robots.txt", http.RobotsTxt)
srv.GET("/favicon.svg", http.Favicon)
srv.ServeStatic("/assets/*filepath", hand.AssetsFS()) srv.ServeStatic("/assets/*filepath", hand.AssetsFS())
srv.GET("/", hand.Index) srv.GET("/", hand.Index)
srv.POST("/", hand.Upload) srv.POST("/", hand.Upload)

View File

@ -225,3 +225,8 @@ func RobotsTxt(w http.ResponseWriter, r *http.Request) {
data, _ := web.AssetsGetFile("robots.txt") data, _ := web.AssetsGetFile("robots.txt")
w.Write(data) w.Write(data)
} }
func Favicon(w http.ResponseWriter, r *http.Request) {
data, _ := web.AssetsGetFile("img/favicon.svg")
w.Write(data)
}