A simple zero-configuration static file server.
Download the latest binary for your platform from the releases page, and run it from the command line
GO111MODULE=on go get -v -u github.com/rbague/simplefileserver
git clone https://github.com/rbague/simplefileserver.git && cd simplefileserver
make setup build-current # generates sfs binary
git clone https://github.com/rbague/simplefileserver.git && cd simplefileserver
make # will generate all the binaries under bin with the following format sfs-GOOS-GOARCH
The server is ready to be used without any configuration, however, there a few options to customize it:
Name | Short | Required | Default | Description |
---|---|---|---|---|
help | - | false | - | Usage instructions |
directory | d | false | . |
The directory where to serve the files from |
path | - | false | / |
The URL path where files should be served from |
host | h | false | - | The host where to bind the server to |
port | p | false | 8080 |
The port where the server should listen to |
cert-file | - | false (true if key-file is present) |
- | SSL certificate file |
key-file | - | false (true if cert-file is present) |
- | SSL certificate's private key |
In order to run the server with TLS activated, pass both the cert-file
and key-file
flags to the startup command.
To enable it locally, you can generate self-signed certificates using mkcert or with the following command
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
The software is available as open source under the terms of the MIT License.