Created
March 10, 2019 14:49
-
-
Save wemgl/66922bde9c2e7b53f8107f95796cb459 to your computer and use it in GitHub Desktop.
Example of serving static content in Go simple server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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