文件服务
This commit is contained in:
1
main.go
1
main.go
@@ -92,6 +92,7 @@ func main() {
|
|||||||
r.HandleFunc("/img/{id}", routers.WebpGet).Methods("GET")
|
r.HandleFunc("/img/{id}", routers.WebpGet).Methods("GET")
|
||||||
|
|
||||||
// 設定靜態資源 (前端) 位于dist目录下
|
// 設定靜態資源 (前端) 位于dist目录下
|
||||||
|
r.PathPrefix("/images/").Handler(http.FileServer(http.Dir("./data/")))
|
||||||
r.PathPrefix("/").Handler(http.FileServer(http.Dir("./dist/")))
|
r.PathPrefix("/").Handler(http.FileServer(http.Dir("./dist/")))
|
||||||
|
|
||||||
log.Println("Web Server is running on http://localhost:8080")
|
log.Println("Web Server is running on http://localhost:8080")
|
||||||
|
Reference in New Issue
Block a user