HTTP server for serving local files to the network simply.
You can go to the releases page for specific OS and
architecture requirements and download binaries.
An example install for a Linux machine could be:
sudo curl -L "https://github.com/eloylp/go-serve/releases/download/v1.3.1/go-serve_1.3.1_Linux_x86_64" \
-o /usr/local/bin/go-serve \
&& sudo chmod +x /usr/local/bin/go-serve
By default, “go-serve” command will serve the current working dir as
its document root and serve its content in all interfaces on port 8080.
$ cd ~
2019/09/02 18:45:02 Starting to serve /home/user at 0.0.0.0:8080 ...
Of course, you can customize these parameters as in this full example:
$ go-serve -l 0.0.0.0:3000 -d /tmp -p /assets
2019/09/02 18:47:02 Starting to serve /tmp at 0.0.0.0:3000 ...
Note that the last option is the prefix from where the files will be served.
If you need to protect your server with a basic authorization https://tools.ietf.org/html/rfc7617,
you need to create an .htpasswd file as the following example:
htpasswd -c users-db user
go-serve -a users-db
The server will watch this file for hot reload
go test ./...