1
0
mirror of https://github.com/golang/go synced 2024-11-20 00:04:43 -07:00
go/doc/codelab/wiki/http-sample.go
2010-09-30 13:19:33 +10:00

16 lines
237 B
Go

package main
import (
"fmt"
"http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}