Add favicon.ico and handler

Created a goreportcard favicon based on the original
https://golang.org/favicon.ico gopher favicon.
This commit is contained in:
Stratos Neiros
2016-02-09 00:44:34 +02:00
parent c1bf402649
commit 6f2a40e392
3 changed files with 7 additions and 0 deletions

BIN
assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -10,3 +10,9 @@ func AssetsHandler(w http.ResponseWriter, r *http.Request) {
log.Println("Serving " + r.URL.Path[1:])
http.ServeFile(w, r, r.URL.Path[1:])
}
// FaviconHandler handles serving the favicon.ico
func FaviconHandler(w http.ResponseWriter, r *http.Request) {
log.Println("Serving " + r.URL.Path[1:])
http.ServeFile(w, r, "assets/favicon.ico")
}

View File

@@ -81,6 +81,7 @@ func main() {
}
http.HandleFunc("/assets/", handlers.AssetsHandler)
http.HandleFunc("/favicon.ico", handlers.FaviconHandler)
http.HandleFunc("/checks", handlers.CheckHandler)
http.HandleFunc("/report/", makeHandler("report", handlers.ReportHandler))
http.HandleFunc("/badge/", makeHandler("badge", handlers.BadgeHandler))