chore: Update Dockerfile and main.go for serving web content from the 'web' directory

This commit is contained in:
skidoodle 2024-05-31 22:15:38 +02:00
parent 23d176dcc7
commit 9b9d9ba192
6 changed files with 216 additions and 225 deletions

View file

@ -115,9 +115,7 @@ func trackIP(ipChan <-chan string) {
}
func serveWeb() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "index.html")
})
http.Handle("/", http.StripPrefix("/", http.FileServer(http.Dir("web"))))
http.HandleFunc("/history", func(w http.ResponseWriter, r *http.Request) {
history, err := readHistory()