From 1e8201bb117f32c48cb3995a2303fe0f80bfe497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=9C=E8=8F=AF?= Date: Sun, 18 Jun 2023 12:55:11 +0800 Subject: [PATCH] DEBUG --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 5dd3a0e..7127fb2 100644 --- a/main.go +++ b/main.go @@ -34,9 +34,6 @@ func main() { }) }) - // 設定靜態資源 (前端) 位于dist目录下 - r.PathPrefix("/").Handler(http.FileServer(http.Dir("./dist/"))) - // 設定路由 r.HandleFunc("/api", routers.GetDocs).Methods("GET") @@ -94,6 +91,9 @@ func main() { r.HandleFunc("/img/{id}", routers.WebpGet).Methods("GET") + // 設定靜態資源 (前端) 位于dist目录下 + r.PathPrefix("/").Handler(http.FileServer(http.Dir("./dist/"))) + log.Println("Web Server is running on http://localhost:8080") if err := http.ListenAndServe(":8080", r); err != nil { log.Fatal(err)