package main
import "net/http"
func main() {
fs := http.FileServer(http.Dir("./"))
http.Handle("/", http.StripPrefix("/", fs))
http.ListenAndServe(":8080", nil)
}
搭建文件服务器,直接搞得
package main
import "net/http"
func main() {
fs := http.FileServer(http.Dir("./"))
http.Handle("/", http.StripPrefix("/", fs))
http.ListenAndServe(":8080", nil)
}
搭建文件服务器,直接搞得