mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
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:
BIN
assets/favicon.ico
Normal file
BIN
assets/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -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")
|
||||
}
|
||||
|
||||
1
main.go
1
main.go
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user