I'm trying to serve a folder in the root of my application called assets
. I want all files and subfolders within there to be accessible through the url /details/
.
fs := http.FileServer(http.Dir("assets"))
http.Handle("/details/", http.StripPrefix("/details/", fs))
I still get 404s for everything. Am I using StripPrefix
incorrectly?
To be clear, suppose assets
contained test.json
. I want that to be accessible from the URL /details/test.json
.