Prevent overlapping default 404 message with custom HTML content

This commit is contained in:
2024-10-08 14:05:12 +07:00
parent 7b77d59e54
commit 340df874c8

View File

@ -32,6 +32,9 @@ import (
func SetupRoutes() *http.ServeMux {
handler := http.NewServeMux()
handler.HandleFunc("GET /{$}", indexHandler.GET)
handler.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
})
authRoute := http.NewServeMux()
handler.Handle("/auth/", http.StripPrefix("/auth", authRoute))