|
|
|
@ -138,6 +138,11 @@ func main() {
|
|
|
|
|
func(w http.ResponseWriter, r *http.Request) any { return nil },
|
|
|
|
|
[]string{http.MethodGet},
|
|
|
|
|
))
|
|
|
|
|
redirectToHome := func(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
http.Redirect(w, r, "/", http.StatusPermanentRedirect)
|
|
|
|
|
}
|
|
|
|
|
r.HandleFunc("/search", redirectToHome)
|
|
|
|
|
r.HandleFunc("/search/", redirectToHome)
|
|
|
|
|
r.HandleFunc("/search/{query}", httputils.GenerateHandler(
|
|
|
|
|
"index.html",
|
|
|
|
|
func(w http.ResponseWriter, r *http.Request) bool {
|
|
|
|
|