1 2 3 4 5 6 7 8 9 10 11 12 13 14
package main import ( "net/http" ) func response(rw http.ResponseWriter, request *http.Request) { rw.Write([]byte("Hello world.")) } func main() { http.HandleFunc("/", response) http.ListenAndServe(":3000", nil) }