Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 26e69b01de
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (18 sloc) 0.528 kB
// hello.go ported for app engine
package patexample
import (
"io"
"net/http"
"github.com/bmizerany/pat"
)
// hello world, the web server
func HelloServer(w http.ResponseWriter, req *http.Request) {
io.WriteString(w, "hello, "+req.URL.Query().Get(":name")+"!\n")
}
func init() {
m := pat.New()
m.Get("/hello/:name", http.HandlerFunc(HelloServer))
// Register this pat with the default serve mux so that other packages
// may also be exported. (i.e. /debug/pprof/*)
http.Handle("/", m)
}
Jump to Line
Something went wrong with that request. Please try again.