go语言http服务处理image/css/js等静态文件

go语言实现http服务器时若是处理静态文件,须要用到http.ServeFile:服务器   func ServeFile(w ResponseWriter, r *Request, name string) { dir, file := filepath.Split(name) serveFile(w, r, Dir(dir), file, false)} 首先根据请求路径r.URL.Path
相关文章
相关标签/搜索