gobyexample/xx-http-server.go
2012-09-20 20:49:36 -07:00

14 lines
270 B
Go

package main
import "net/http"
func hello(res http.ResponseWriter, req *http.Request) {
res.Header().Set("Content-Type", "text/plain")
res.Write([]byte("Hello From HTTP\n"))
}
func main() {
http.HandleFunc("/", hello)
http.ListenAndServe(":5000", nil)
}