go-gzip-file-server
go-gzip-file-server copied to clipboard
A net.http.Handler similar to FileServer that serves gzipped content
net.http.handler.gzip: a FileServer that serves gzipped content.
Usage:
import "net/http/handler/gzip"
base := "/path/to/website/static/files" http.Handle("/static", http.StripPrefix("/static", gzip.FileServer(http.Dir(base))))
Run the example:
(checkout)
export GOPATH=pwd
go install net/http/handler/gzip/example
./bin/example
Usage of http.FileServer can be replaced with gzip.FileServer. A request for