Function
serveHome
examples/command/main.go:168–178
· examples/command/main.go::serveHome
(w http.ResponseWriter, r *http.Request)
Source from the content-addressed store, hash-verified
| 166 | } |
| 167 | |
| 168 | func serveHome(w http.ResponseWriter, r *http.Request) { |
| 169 | if r.URL.Path != "/" { |
| 170 | http.Error(w, "Not found", http.StatusNotFound) |
| 171 | return |
| 172 | } |
| 173 | if r.Method != http.MethodGet { |
| 174 | http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) |
| 175 | return |
| 176 | } |
| 177 | http.ServeFile(w, r, "home.html") |
| 178 | } |
| 179 | |
| 180 | func main() { |
| 181 | flag.Parse() |
Callers
nothing calls this directly
Tested by
no test coverage detected