package main import "net/http" func main() { // 启动一个文件服务器 http.ListenAndServe(":8080", http.FileServer(http.Dir("."))) }
其实Python也很简单,也许更简单一些,只不过需要Python的环境,可移植性不如Go这样最终产物为可执行文件的语言。不过也给个例子吧
python -m http.server 8090
guoxj
Python的命令是在shell