我有这些处理程序:
func StartHttpServer(ipAddr string) {
mux := http.NewServeMux()
mux.HandleFunc("/printJson", PrintJsonHandler)
mux.HandleFunc("/report", RaportHandler)
mux.HandleFunc("/returnBalancesDates", ReturnBalancesDatesHandler)
mux.Handle("/", http.FileServer(http.Dir("./static")))
mux.Handle("/readfiles/", http.FileServer(http.Dir("./reports")))
err := http.ListenAndServe(ipAddr, mux)
if err != nil {
log.Fatal("ERROR: Http Server crashed: ", err)
}
}
但似乎第二个 FileServer 处理程序没有像我预期的那样从文件夹“报告”返回文件
宝慕林4294392
相关分类