Add proxy service argument to LbrynetPublisher initialization
@@ -10,19 +10,19 @@ import (
)
// InstallRoutes sets up global API handlers
-func InstallRoutes(ps *proxy.Service, r *mux.Router) {
+func InstallRoutes(proxyService *proxy.Service, r *mux.Router) {
r.HandleFunc("/", Index)
- proxyServer := proxy.NewRequestServer(ps)
+ proxyHandler := proxy.NewRequestServer(proxyService)
- r.HandleFunc("/api/proxy", captureErrors(proxyServer.Handle))
- r.HandleFunc("/api/proxy/", captureErrors(proxyServer.Handle))
+ r.HandleFunc("/api/proxy", captureErrors(proxyHandler.Handle))
+ r.HandleFunc("/api/proxy/", captureErrors(proxyHandler.Handle))
r.HandleFunc("/content/claims/{uri}/{claim}/{filename}", captureErrors(ContentByClaimsURI))
r.HandleFunc("/content/url", captureErrors(ContentByURL))
actionsRouter := r.Path("/api/v1/actions").Subrouter()
authenticator := users.NewAuthenticator(users.NewUserService())
- lbrynetPublisher := &publish.LbrynetPublisher{}
+ lbrynetPublisher := &publish.LbrynetPublisher{Service: proxyService}
UploadHandler := publish.NewUploadHandler(config.GetPublishDir(), lbrynetPublisher)
actionsRouter.HandleFunc("/publish", authenticator.Wrap(UploadHandler.Handle)).Headers(users.TokenHeader, "")
}
