Skip to content

Instantly share code, notes, and snippets.

@jhbabon
Created February 12, 2014 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhbabon/8956162 to your computer and use it in GitHub Desktop.
Save jhbabon/8956162 to your computer and use it in GitHub Desktop.
Golang static files server (copy of https://coderwall.com/p/up2jbg)
package main
import "net/http"
// https://coderwall.com/p/up2jbg
func main() {
http.Handle("/", http.FileServer(http.Dir("_site")))
err := http.ListenAndServe(":8000", nil)
if err != nil {
panic(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment