From d4fb0e45635b1d4c55a930c87726eec41ce6876c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sun, 19 Mar 2023 00:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8E=E7=AB=AFapi?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/main.go | 4 ++-- main.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/main.go b/backend/main.go index 8e35220..7dbbcb6 100644 --- a/backend/main.go +++ b/backend/main.go @@ -179,8 +179,8 @@ func init() { }} } -// Handler serves all backend /api call -func Handler(w http.ResponseWriter, r *http.Request) { +// APIHandler serves all backend /api call +func APIHandler(w http.ResponseWriter, r *http.Request) { if r.URL.Path[0] != '/' { r.URL.Path = "/" + r.URL.Path } diff --git a/main.go b/main.go index b71d300..0ef92a5 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ func main() { os.Exit(line()) } - http.HandleFunc("/api/", backend.Handler) + http.HandleFunc("/api/", backend.APIHandler) http.HandleFunc("/file/", backend.FileHandler) http.HandleFunc("/upload", backend.UploadHandler)