chore(ods): added logging of search results and updated code comments

This commit is contained in:
Julien Dessaux 2024-04-02 02:06:10 +02:00
parent da203d45ec
commit d023b41fa8
Signed by: adyxax
GPG key ID: F92E51B86E07177E

View file

@ -12,7 +12,7 @@ import (
"unicode" "unicode"
) )
// Variables to customise the search behaviour // Variables to customise the search
const ( const (
listenStr = "0.0.0.0:8090" listenStr = "0.0.0.0:8090"
) )
@ -63,12 +63,12 @@ func postIndex() http.Handler {
break break
} }
} }
slog.Info("post", "word", query, "invalid", data.Invalid)
w.Header().Set("Cache-Control", "no-store, no-cache") w.Header().Set("Cache-Control", "no-store, no-cache")
indexTemplate.ExecuteTemplate(w, "index.html", data) indexTemplate.ExecuteTemplate(w, "index.html", data)
}) })
} }
// The main function
func main() { func main() {
http.Handle("GET /static/", http.FileServer(http.FS(static))) http.Handle("GET /static/", http.FileServer(http.FS(static)))
http.Handle("GET /", getIndex()) http.Handle("GET /", getIndex())