From 9947835ba147302c45de64abf26db6e5a7de97c1 Mon Sep 17 00:00:00 2001 From: mountain Date: Thu, 22 Jun 2023 20:35:35 +0900 Subject: [PATCH] =?UTF-8?q?deploys,=20downloads=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/http_api.go | 2 +- server/http_handler.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/http_api.go b/server/http_api.go index 917cb5c..fa96ff9 100644 --- a/server/http_api.go +++ b/server/http_api.go @@ -48,7 +48,7 @@ func (h *houstonHandler) GetDeploySources(w http.ResponseWriter, r *http.Request ver := fd.Name() files, _ := os.ReadDir(path.Join(h.deployPath, name, ver)) if len(files) > 0 { - downloadpath := path.Join(h.deployPath, name, ver, files[0].Name()) + downloadpath := path.Join(sub_folder_name_deploys, name, ver, files[0].Name()) ver = fmt.Sprintf("%s:%s", ver, downloadpath) } out = append(out, ver) diff --git a/server/http_handler.go b/server/http_handler.go index 546153d..8a7c59d 100644 --- a/server/http_handler.go +++ b/server/http_handler.go @@ -66,10 +66,10 @@ func (h *houstonHandler) RegisterHandlers(serveMux *http.ServeMux, prefix string serveMux.Handle(prefix, h) fsx := http.FileServer(http.Dir(h.deployPath)) - serveMux.Handle(fmt.Sprintf("%s/deploys/", prefix), http.StripPrefix(fmt.Sprintf("%s/deploys/", prefix), fsx)) + serveMux.Handle(fmt.Sprintf("%s/%s/", prefix, sub_folder_name_deploys), http.StripPrefix(fmt.Sprintf("%s/deploys/", prefix), fsx)) ufsx := http.FileServer(http.Dir(h.downloadPath)) - serveMux.Handle(fmt.Sprintf("%s/downloads/", prefix), http.StripPrefix(fmt.Sprintf("%s/downloads/", prefix), ufsx)) + serveMux.Handle(fmt.Sprintf("%s/%s/", prefix, sub_folder_name_downloads), http.StripPrefix(fmt.Sprintf("%s/downloads/", prefix), ufsx)) serveMux.HandleFunc(fmt.Sprintf("%s/upload", prefix), func(w http.ResponseWriter, r *http.Request) { defer func() {