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"))))
例子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"))))
来杯咖啡~