Sergiusz Bazanski | c881cf3 | 2020-04-08 20:03:12 +0200 | [diff] [blame] | 1 | package main |
2 | |||||
3 | import ( | ||||
4 | "fmt" | ||||
5 | "net/http" | ||||
6 | ) | ||||
7 | |||||
8 | func handle404(w http.ResponseWriter, r *http.Request) { | ||||
9 | logRequest(w, r, "404") | ||||
10 | w.WriteHeader(http.StatusNotFound) | ||||
11 | fmt.Fprintf(w, "404!\n") | ||||
12 | } | ||||
13 | |||||
14 | func handle500(w http.ResponseWriter, r *http.Request) { | ||||
15 | logRequest(w, r, "500") | ||||
16 | w.WriteHeader(http.StatusNotFound) | ||||
17 | fmt.Fprintf(w, "500 :(\n") | ||||
18 | } |