Skip to content

Instantly share code, notes, and snippets.

@gnilchee
Created July 17, 2015 03:49
Show Gist options
  • Save gnilchee/ea875e544938b8e26f52 to your computer and use it in GitHub Desktop.
Save gnilchee/ea875e544938b8e26f52 to your computer and use it in GitHub Desktop.
Go HTTP Server
package main
import "net/http"
func main() {
// http.Handle is relative to directory where http.go is run from
// http.Dir is relative path from where http.go was executed from
http.Handle("/", http.FileServer(http.Dir("./html")))
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment