| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be 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 "golang.org/x/net/context" | 10 "golang.org/x/net/context" |
| 11 | 11 |
| 12 "github.com/julienschmidt/httprouter" | |
| 13 "github.com/luci/luci-go/appengine/logdog/coordinator" | 12 "github.com/luci/luci-go/appengine/logdog/coordinator" |
| 14 "github.com/luci/luci-go/appengine/logdog/coordinator/config" | 13 "github.com/luci/luci-go/appengine/logdog/coordinator/config" |
| 15 "github.com/luci/luci-go/appengine/tumble" | 14 "github.com/luci/luci-go/appengine/tumble" |
| 15 "github.com/luci/luci-go/server/router" |
| 16 | 16 |
| 17 // Include mutations package so its Mutations will register with tumble
via | 17 // Include mutations package so its Mutations will register with tumble
via |
| 18 // init(). | 18 // init(). |
| 19 _ "github.com/luci/luci-go/appengine/logdog/coordinator/mutations" | 19 _ "github.com/luci/luci-go/appengine/logdog/coordinator/mutations" |
| 20 ) | 20 ) |
| 21 | 21 |
| 22 func init() { | 22 func init() { |
| 23 tmb := tumble.Service{ | 23 tmb := tumble.Service{ |
| 24 Middleware: func(c context.Context) context.Context { | 24 Middleware: func(c context.Context) context.Context { |
| 25 if err := config.UseConfig(&c); err != nil { | 25 if err := config.UseConfig(&c); err != nil { |
| 26 panic(err) | 26 panic(err) |
| 27 } | 27 } |
| 28 c = coordinator.UseProdServices(c) | 28 c = coordinator.UseProdServices(c) |
| 29 return c | 29 return c |
| 30 }, | 30 }, |
| 31 } | 31 } |
| 32 | 32 |
| 33 » router := httprouter.New() | 33 » r := router.New() |
| 34 » tmb.InstallHandlers(router) | 34 » tmb.InstallHandlers(r) |
| 35 | 35 |
| 36 » http.Handle("/", router) | 36 » http.Handle("/", r) |
| 37 } | 37 } |
| OLD | NEW |