gobyexample/094-http-server/http-server.go
Mark McGranaghan ebe6383f98 renumber again
2012-09-23 13:29:28 -07:00

16 lines
289 B
Go

// ## HTTP Server
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)
}