A Golang static file server example.
- Make sure that the path passed in
http.FileServer(http.Dir("XX"))
is ABSOLUTE. http.Dir("./static")
works only ifPWD
is the server root dir.- Use GetCurrentExecDir to get absolute path of server root(current executable).