Skip to content

Instantly share code, notes, and snippets.

@gliheng
Created October 30, 2014 15:24
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 gliheng/13988e03519bc1aaaeb8 to your computer and use it in GitHub Desktop.
Save gliheng/13988e03519bc1aaaeb8 to your computer and use it in GitHub Desktop.
fast static http server with go
package main
import (
"os"
"log"
"net/http"
)
func main() {
port := "8000"
log.Println("Listening on port", port)
pwd, _ := os.Getwd()
http.Handle("/", http.FileServer(http.Dir(pwd)))
log.Fatal(http.ListenAndServe(":" + port, nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment