gobyexample/069-http-server-static.go
Mark McGranaghan 354a9d862f reorder
2012-09-21 07:54:20 -07:00

22 lines
399 B
Go

package main
import "net/http"
func main() {
handler := http.FileServer(http.Dir("./"))
http.ListenAndServe(":5000", handler)
}
// == running
// $ cd src
// $ go run xx-http-server-static.go
//
// $ curl http://127.0.0.1:5000/
// $ curl http://127.0.0.1:5000/xx-http-server-static.go
// $ curl http://127.0.0.1:5000/missing
// == todo
// index pages
// disable listing
// custom 404 handling