在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
package main import ( "fmt" "log" "net/http" "os" "path/filepath" ) func main() { log.Println("Server Port: " + os.Args[1]) log.Println("Server Workdir: " + os.Args[2]) p, _ := filepath.Abs(filepath.Dir(os.Args[2] + "\\")) http.Handle("/", http.FileServer(http.Dir(p))) err := http.ListenAndServe(":"+os.Args[1], nil) if err != nil { fmt.Println(err) } }
|
请发表评论