| Index: appengine/cmd/helloworld_mvm/backend/main.go
|
| diff --git a/appengine/cmd/helloworld_mvm/backend/main.go b/appengine/cmd/helloworld_mvm/backend/main.go
|
| index 23e62c89f6ed29985ff19d978aad7e5ddbdc5219..138e837fed040fd90ff10c36bad0eda1872c440b 100644
|
| --- a/appengine/cmd/helloworld_mvm/backend/main.go
|
| +++ b/appengine/cmd/helloworld_mvm/backend/main.go
|
| @@ -9,25 +9,23 @@ package main
|
| import (
|
| "net/http"
|
|
|
| - "github.com/julienschmidt/httprouter"
|
| - "golang.org/x/net/context"
|
| "google.golang.org/appengine"
|
|
|
| "github.com/luci/luci-go/appengine/gaemiddleware"
|
| - "github.com/luci/luci-go/server/middleware"
|
| + "github.com/luci/luci-go/server/router"
|
| )
|
|
|
| // base is the root of the middleware chain.
|
| -func base(h middleware.Handler) httprouter.Handle {
|
| - return gaemiddleware.BaseProd(h)
|
| +func base() []router.Handler {
|
| + return gaemiddleware.BaseProd()
|
| }
|
|
|
| //// Routes.
|
|
|
| func main() {
|
| - router := httprouter.New()
|
| - gaemiddleware.InstallHandlers(router, base)
|
| - router.GET("/hi", base(sayHi))
|
| + router := router.New()
|
| + gaemiddleware.InstallHandlers(router, base())
|
| + router.GET("/hi", append(base(), sayHi)...)
|
| http.DefaultServeMux.Handle("/", router)
|
|
|
| appengine.Main()
|
| @@ -35,6 +33,6 @@ func main() {
|
|
|
| //// Handlers.
|
|
|
| -func sayHi(c context.Context, w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
| - w.Write([]byte("Hi, I'm backend"))
|
| +func sayHi(c *router.Context) {
|
| + c.Writer.Write([]byte("Hi, I'm backend"))
|
| }
|
|
|