使用go语言几行代码就实现了http文件服务器,不能再快了。https://download.csdn.net/my

 

package main

import (
	"fmt"
	"net/http"
)

func main() {
	fmt.Println("hello。。。。")

	http.Handle("/", http.FileServer(http.Dir(".")))
	http.ListenAndServe(":8080", nil)

}

编译生成main.exe  放到你想要的目录下。双击运行

浏览器输入:http://127.0.0.1:8080  效果来了

 

用Go实现 最简单实现 http文件服务器

 

 

 

相关文章:

  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-12-30
  • 2021-09-15
猜你喜欢
  • 2022-12-23
  • 2022-01-07
  • 2021-07-27
  • 2022-12-23
  • 2022-02-03
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案