Go语言实现简单的文件服务器
发布时间:2020-12-16 18:42:06 所属栏目:大数据 来源:网络整理
导读:package mainimport ("fmt""net/http")func main() {http.Handle("/",http.FileServer(http.Dir("./")))e := http.ListenAndServe(":8080",nil)fmt.Println(e)}
package main import ( "fmt" "net/http" ) func main() { http.Handle("/",http.FileServer(http.Dir("./"))) e := http.ListenAndServe(":8080",nil) fmt.Println(e) } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |