There are many static file servers written in Go (and friends). This one is ours.
This package is no longer being maintained. You should use aaronland/go-http-fileserver or something equivalent instead.
You will need to have both Go
(specifically version 1.12 or higher because we're using Go modules) and the make
programs installed on your computer. Assuming you do just type:
make tools
All of this package's dependencies are bundled with the code in the vendor
directory.
> ./bin/www-fileserver -h
Usage of ./bin/www-fileserver:
-cors
Enable CORS header on responses
-cors-allowed-origins string
Comma-separated list of CORS allowed origins (default "*")
-gzip
gzip response bodies
-host string
Hostname to listen on (default "localhost")
-path string
Path served as document root. (default "./")
-port int
Port to listen on (default 8080)
- Support for TLS certificates