func main() {
fileserver := http.FileServer(http.Dir("./static"))
http.Handle("/fill", fileserver)
http.Handle("/", fileserver)
http.HandleFunc("/form", formHandler)
http.HandleFunc("/hello", helloHandler)
fmt.Printf("Starting server at port 8080\n")
if err := http.ListenAndServe(":8080", nil); err != nil {
log.Fatal(err)
}
}
So what I am trying to do is when I access localhost/ or localhost/fill it should connect to the index.html file. But it doesn't do so when I do /fill, but works when I do localhost/. I thought it might be a problem because it's one page and both patterns are leading there and I get the same 404 error page not found when I take out line 4.
So anyone has an idea what I'm doing wrong?