From 2723f20ab0c086dc0c7a836cba4b3888e3825bb6 Mon Sep 17 00:00:00 2001 From: Grendgi Date: Tue, 16 Jun 2026 13:57:55 +0300 Subject: [PATCH] fix: support files proxy root paths --- cmd/server/main.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 0b1f146..2d4edc0 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -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)