Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileServer ¶
func FileServer(root http.FileSystem) http.Handler
ContentEncodingFileServer is a thin wrapper around http.FileServer(). It servers zipped files with the appropriate Content-Encoding http response header, so that you can use zipped files directly. Example: You want to use that in html:
<script src="/static/htmx.min.js.gz"></script>
Go code: http.Handle("/static/", http.StripPrefix("/static/",
contentencodingfileserver.FileServer(http.Dir("./static")))))
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.