Skip to content

Instantly share code, notes, and snippets.

@supr
Created August 23, 2011 19:50
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save supr/1166302 to your computer and use it in GitHub Desktop.
Save supr/1166302 to your computer and use it in GitHub Desktop.
For golang http.Handler to serve static files on /foo mounted at /xyz/foo
package main
import (
"http"
)
func main() {
http.Handle("/foo/", http.StripPrefix("/foo", http.FileServer(http.Dir("/xyz/foo/"))))
http.ListenAndServe(":6543", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment