I can't quite seem to get a fileserver working on a basic http server I am
running.
The directory is as follows:
/--App/
--- app.go (fileserver code)
--public/
--- js/
-- main.js
-- etc...
Basically the App and public folders are at the same level, and since the--public/
--- js/
-- main.js
-- etc...
app.go (fileserver) is in the App folder, to access the public folder
contents I use the following code (I assume):
http.Handle("/public/", http.FileServer(http.Dir("../public")))
http.ListenAndServe(":8080", nil)
The problem is that when I go to localhost:8080/public/js/main.js, I just
get a "404 Not Found".
Since the two folders are at the same level, I can't quite figure out what
the code should be to access the contents of public?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.