fix: support files proxy root paths
This commit is contained in:
@@ -66,8 +66,7 @@ func main() {
|
|||||||
r.Get("/healthz", healthH.Healthz)
|
r.Get("/healthz", healthH.Healthz)
|
||||||
r.Get("/readyz", healthH.Readyz)
|
r.Get("/readyz", healthH.Readyz)
|
||||||
|
|
||||||
r.Route("/api", func(r chi.Router) {
|
mountFilesAPI := func(r chi.Router) {
|
||||||
r.Use(commonmw.InternalAuth(cfg.InternalAPIKey))
|
|
||||||
r.Get("/nodes", nodeH.List)
|
r.Get("/nodes", nodeH.List)
|
||||||
r.Post("/folders", nodeH.CreateFolder)
|
r.Post("/folders", nodeH.CreateFolder)
|
||||||
r.Post("/files", nodeH.UploadFile)
|
r.Post("/files", nodeH.UploadFile)
|
||||||
@@ -80,6 +79,15 @@ func main() {
|
|||||||
r.Put("/access", nodeH.ReplaceAccess)
|
r.Put("/access", nodeH.ReplaceAccess)
|
||||||
r.Post("/public-links", nodeH.CreatePublicLink)
|
r.Post("/public-links", nodeH.CreatePublicLink)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
r.Route("/api", func(r chi.Router) {
|
||||||
|
r.Use(commonmw.InternalAuth(cfg.InternalAPIKey))
|
||||||
|
mountFilesAPI(r)
|
||||||
|
})
|
||||||
|
r.Group(func(r chi.Router) {
|
||||||
|
r.Use(commonmw.InternalAuth(cfg.InternalAPIKey))
|
||||||
|
mountFilesAPI(r)
|
||||||
})
|
})
|
||||||
|
|
||||||
r.Get("/public/{token}", nodeH.PublicMeta)
|
r.Get("/public/{token}", nodeH.PublicMeta)
|
||||||
|
|||||||
Reference in New Issue
Block a user