fix: support files proxy root paths
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user