golang http

静态文件服务

例子1:

http.Handle("/lib/", http.StripPrefix("/l", http.FileServer(http.Dir("ddd"))))

例子1寻找路径:

ddd + (/lib/ strip /l)
ddd/ib

绝对路径变相对:

	http.Handle("/web/", http.StripPrefix("/web", http.FileServer(http.Dir("web"))))
支付宝打赏 微信打赏

您的打赏是对我最大的鼓励!

Table of Contents