gobyexample/072-hello-web/hello-web.go
Mark McGranaghan 1f7065e387 index work
2012-09-23 18:06:40 -07:00

16 lines
281 B
Go

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