Created
July 17, 2015 03:49
-
-
Save gnilchee/ea875e544938b8e26f52 to your computer and use it in GitHub Desktop.
Go HTTP Server
This file contains hidden or 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
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