s/setupRoutes/NewRouter

This commit is contained in:
Jimmy Zelinskie 2014-07-16 04:40:51 -04:00
parent a614f42a94
commit 65bd11f636
2 changed files with 3 additions and 3 deletions

View file

@ -62,7 +62,7 @@ func makeHandler(handler ResponseHandler) httprouter.Handle {
} }
} }
func setupRoutes(t *Tracker, cfg *config.Config) *httprouter.Router { func NewRouter(t *Tracker, cfg *config.Config) *httprouter.Router {
r := httprouter.New() r := httprouter.New()
if cfg.Private { if cfg.Private {
@ -94,7 +94,7 @@ func Serve(cfg *config.Config) {
glog.Fatal("New: ", err) glog.Fatal("New: ", err)
} }
graceful.Run(cfg.Addr, cfg.RequestTimeout.Duration, setupRoutes(t, cfg)) graceful.Run(cfg.Addr, cfg.RequestTimeout.Duration, NewRouter(t, cfg))
} }
func fail(w http.ResponseWriter, r *http.Request, err error) { func fail(w http.ResponseWriter, r *http.Request, err error) {

View file

@ -31,7 +31,7 @@ func setupTracker(cfg *config.Config) (*httptest.Server, error) {
} }
func createServer(tkr *Tracker, cfg *config.Config) (*httptest.Server, error) { func createServer(tkr *Tracker, cfg *config.Config) (*httptest.Server, error) {
return httptest.NewServer(setupRoutes(tkr, cfg)), nil return httptest.NewServer(NewRouter(tkr, cfg)), nil
} }
func announce(p params, srv *httptest.Server) ([]byte, error) { func announce(p params, srv *httptest.Server) ([]byte, error) {