fix: support files proxy root paths
All checks were successful
CI / hygiene (push) Successful in 1s
Build and Deploy / build-and-deploy (push) Successful in 29s
CI / test (push) Successful in 19s

This commit is contained in:
Grendgi
2026-06-16 13:57:55 +03:00
parent f12487d036
commit 2723f20ab0

View File

@@ -66,8 +66,7 @@ func main() {
r.Get("/healthz", healthH.Healthz)
r.Get("/readyz", healthH.Readyz)
r.Route("/api", func(r chi.Router) {
r.Use(commonmw.InternalAuth(cfg.InternalAPIKey))
mountFilesAPI := func(r chi.Router) {
r.Get("/nodes", nodeH.List)
r.Post("/folders", nodeH.CreateFolder)
r.Post("/files", nodeH.UploadFile)
@@ -80,6 +79,15 @@ func main() {
r.Put("/access", nodeH.ReplaceAccess)
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)