I'm using the snippet below:
fa := http.FileServer(http.Dir("attach/"))
http.Handle("/attach", fa)
The files are located into /attach/
directory. However when I hit localhost/attach or localhost/attach/anyfile
it throws not found error
I'm using the snippet below:
fa := http.FileServer(http.Dir("attach/"))
http.Handle("/attach", fa)
The files are located into /attach/
directory. However when I hit localhost/attach or localhost/attach/anyfile
it throws not found error
If the files are located under /attach then the pathname used with http.Dir() is wrong, unless the current directoy is /.