StripPrefix
已收录文章:1篇
-
例子: http.Handle("/tmpfiles/", http.StripPrefix("/tmpfiles/", http.FileServer(http.Dir("/tmp")))) 当访问localhost:xxxx/tmpfiles时,会路由到fileserver进行处理 当访问URL为/tmpfiles/example.txt时,fileserver会将/tmp与URL进行拼356 收藏