package main import "net/http" //定义文件服务器的根路径 var dirRoot string = "/Users/zjq" func main() { http.Handle("/", http.FileServer(http.Dir(dirRoot))) http.ListenAndServe(":8018", nil) }
package main import "net/http" //定义文件服务器的根路径 var dirRoot string = "/Users/zjq" func main() { http.Handle("/", http.FileServer(http.Dir(dirRoot))) http.ListenAndServe(":8018", nil) }