mirror of
https://github.com/LBRYFoundation/tracker.git
synced 2025-08-30 08:51:30 +00:00
s/setupRoutes/NewRouter
This commit is contained in:
parent
a614f42a94
commit
65bd11f636
2 changed files with 3 additions and 3 deletions
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue