| Index: appengine/cmd/logdog_coordinator/services/main.go
|
| diff --git a/appengine/cmd/logdog_coordinator/services/main.go b/appengine/cmd/logdog_coordinator/services/main.go
|
| index 1edfb9897549c9694772d928b59bb12cb07f4723..d6c55e623ce54c3a973ab45ab506cf6e8cb97f77 100644
|
| --- a/appengine/cmd/logdog_coordinator/services/main.go
|
| +++ b/appengine/cmd/logdog_coordinator/services/main.go
|
| @@ -1,46 +1,47 @@
|
| // Copyright 2015 The LUCI Authors. All rights reserved.
|
| // Use of this source code is governed under the Apache License, Version 2.0
|
| // that can be found in the LICENSE file.
|
|
|
| package module
|
|
|
| import (
|
| "net/http"
|
|
|
| - "github.com/julienschmidt/httprouter"
|
| "github.com/luci/luci-go/appengine/gaemiddleware"
|
| "github.com/luci/luci-go/appengine/logdog/coordinator"
|
| "github.com/luci/luci-go/appengine/logdog/coordinator/config"
|
| "github.com/luci/luci-go/appengine/logdog/coordinator/endpoints/registration"
|
| "github.com/luci/luci-go/appengine/logdog/coordinator/endpoints/services"
|
| registrationPb "github.com/luci/luci-go/common/api/logdog_coordinator/registration/v1"
|
| servicesPb "github.com/luci/luci-go/common/api/logdog_coordinator/services/v1"
|
| - "github.com/luci/luci-go/server/middleware"
|
| "github.com/luci/luci-go/server/prpc"
|
| + "github.com/luci/luci-go/server/router"
|
|
|
| // Include mutations package so its Mutations will register with tumble via
|
| // init().
|
| _ "github.com/luci/luci-go/appengine/logdog/coordinator/mutations"
|
| )
|
|
|
| -// base is the root of the middleware chain.
|
| -func base(h middleware.Handler) httprouter.Handle {
|
| - h = config.WithConfig(h)
|
| - h = coordinator.WithProdServices(h)
|
| - return gaemiddleware.BaseProd(h)
|
| +// base returns the root middleware chain.
|
| +func base() router.MiddlewareChain {
|
| + return append(
|
| + gaemiddleware.BaseProd(),
|
| + coordinator.WithProdServices,
|
| + config.WithConfig,
|
| + )
|
| }
|
|
|
| // Run installs and executes this site.
|
| func init() {
|
| - router := httprouter.New()
|
| + r := router.New()
|
|
|
| // Setup Cloud Endpoints.
|
| svr := prpc.Server{}
|
| servicesPb.RegisterServicesServer(&svr, services.New())
|
| registrationPb.RegisterRegistrationServer(&svr, registration.New())
|
|
|
| // Standard HTTP endpoints.
|
| - svr.InstallHandlers(router, base)
|
| + svr.InstallHandlers(r, base())
|
|
|
| - http.Handle("/", router)
|
| + http.Handle("/", r)
|
| }
|
|
|