mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
21 lines
490 B
Go
21 lines
490 B
Go
package handlers
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
// AssetsHandler handles serving static files
|
|
func AssetsHandler(w http.ResponseWriter, r *http.Request) {
|
|
log.Println("Serving " + r.URL.Path[1:])
|
|
w.Header().Set("Cache-Control", "max-age=86400")
|
|
|
|
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")
|
|
}
|