Add 404 for nonexistent pages

This commit is contained in:
Chandler Swift 2023-10-12 22:04:18 -05:00
parent 46d18a018e
commit 8b0242419d
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F

View file

@ -75,6 +75,7 @@ func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" { if r.URL.Path != "/" {
http.NotFound(w, r) http.NotFound(w, r)
return
} }
// Update servers with current data // Update servers with current data