Skip to content

Instantly share code, notes, and snippets.

@graphaelli
Created December 1, 2013 02:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graphaelli/7727798 to your computer and use it in GitHub Desktop.
Save graphaelli/7727798 to your computer and use it in GitHub Desktop.
package main
import (
"flag"
"fmt"
"log"
"net/http"
)
func main() {
var port = flag.Int("port", 8080, "port")
flag.Parse()
log.Fatal(http.ListenAndServe(fmt.Sprintf("127.0.0.1:%d", *port), http.FileServer(http.Dir('.'))))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment