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"))))
支付宝打赏 微信打赏

来杯咖啡~

文章导航