| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package module | 5 package module |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "net/http" | 8 "net/http" |
| 9 | 9 |
| 10 "github.com/julienschmidt/httprouter" | 10 "github.com/julienschmidt/httprouter" |
| 11 "github.com/luci/luci-go/appengine/gaemiddleware" | 11 "github.com/luci/luci-go/appengine/gaemiddleware" |
| 12 "github.com/luci/luci-go/appengine/logdog/coordinator" | 12 "github.com/luci/luci-go/appengine/logdog/coordinator" |
| 13 » "github.com/luci/luci-go/appengine/logdog/coordinator/endpoints/services
" | 13 » "github.com/luci/luci-go/appengine/logdog/coordinator/endpoints/registra
tion" |
| 14 » servicesPb "github.com/luci/luci-go/common/api/logdog_coordinator/servic
es/v1" | 14 » registrationPb "github.com/luci/luci-go/common/api/logdog_coordinator/re
gistration/v1" |
| 15 "github.com/luci/luci-go/server/middleware" | 15 "github.com/luci/luci-go/server/middleware" |
| 16 "github.com/luci/luci-go/server/prpc" | 16 "github.com/luci/luci-go/server/prpc" |
| 17 | 17 |
| 18 // Include mutations package so its Mutations will register with tumble
via | 18 // Include mutations package so its Mutations will register with tumble
via |
| 19 // init(). | 19 // init(). |
| 20 _ "github.com/luci/luci-go/appengine/logdog/coordinator/mutations" | 20 _ "github.com/luci/luci-go/appengine/logdog/coordinator/mutations" |
| 21 ) | 21 ) |
| 22 | 22 |
| 23 // base is the root of the middleware chain. | 23 // base is the root of the middleware chain. |
| 24 func base(h middleware.Handler) httprouter.Handle { | 24 func base(h middleware.Handler) httprouter.Handle { |
| 25 h = coordinator.WithProdServices(h) | 25 h = coordinator.WithProdServices(h) |
| 26 return gaemiddleware.BaseProd(h) | 26 return gaemiddleware.BaseProd(h) |
| 27 } | 27 } |
| 28 | 28 |
| 29 // Run installs and executes this site. | 29 // Run installs and executes this site. |
| 30 func init() { | 30 func init() { |
| 31 router := httprouter.New() | 31 router := httprouter.New() |
| 32 | 32 |
| 33 // Setup Cloud Endpoints. | 33 // Setup Cloud Endpoints. |
| 34 svr := prpc.Server{} | 34 svr := prpc.Server{} |
| 35 » servicesPb.RegisterServicesServer(&svr, services.New()) | 35 » registrationPb.RegisterRegistrationServer(&svr, registration.New()) |
| 36 | 36 |
| 37 // Standard HTTP endpoints. | 37 // Standard HTTP endpoints. |
| 38 svr.InstallHandlers(router, base) | 38 svr.InstallHandlers(router, base) |
| 39 | 39 |
| 40 http.Handle("/", router) | 40 http.Handle("/", router) |
| 41 } | 41 } |
| OLD | NEW |