I'm trying to serve static files via http.FileServer, however it never sends back the directory I'm asking for. The code is snipped below:
func main() {
fmt.Println("Serving Files")
http.HandleFunc("/", homeFunc)
http.HandleFunc("/search", searchFunc)
http.Handle("/tmp/",
http.StripPrefix("/tmp/", http.FileServer(http.Dir("/assets"))))
http.ListenAndServe(":8080", nil)
}
When visiting mywebsite.com/tmp/, text appears saying "404 page not found." A little help in case I'm missing something would be greatly appreciated!
Edit: Here's the file architecture:
main folder
|
|-/Assets
|--(assets)
|
|-main.go