Skip to content

Instantly share code, notes, and snippets.

@wemgl
Created March 10, 2019 14:49
Show Gist options
  • Save wemgl/66922bde9c2e7b53f8107f95796cb459 to your computer and use it in GitHub Desktop.
Save wemgl/66922bde9c2e7b53f8107f95796cb459 to your computer and use it in GitHub Desktop.
Example of serving static content in Go simple server
// public serves static assets such as CSS and JavaScript to clients.
func public() http.Handler {
return http.StripPrefix("/public/", http.FileServer(http.Dir("./public")))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment