gobyexample/tools/serve.go
2019-05-29 13:49:42 -07:00

14 lines
237 B
Go

package main
import (
"fmt"
"net/http"
)
func main() {
port := "8000"
publicDir := "public"
fmt.Printf("Serving Go by Example at http://127.0.0.1:%s\n", port)
http.ListenAndServe(":"+port, http.FileServer(http.Dir(publicDir)))
}