s
A pet project to have some fun in Go.
It's called s because you use it to serve file or directory.
This is a rip off of the idea of Simon Budig's woof.
You can serve either:
- serve a file (1 or N times; at the end of the count; the app closes)
- serve a directory until you close the app. (useful for dev purposes)
The default port is 4242 (so you don't need special ACL to run it; you can
change it with '--port'.
It will listen on all your interfaces; so if the IP found is not the one you
want to use, you can simply change the URL.
Install
Still here ? Wow.
Well, if your REALLY want to use it, you can do:
go install github.com/maximeh/s@latest
Compile
To compile for other system; use:
go tool dist list
to view the list of of possible platforms.
Then run:
env GOOS=linux GOARCH=amd64 go build
to compile that binary.
And that should be it, it should download and compile everything.
systemd
Once built, put the binary somewhere on your system; example:
sudo cp s /usr/local/bin/
Copy the service into systemd's structure and enable the service:
sudo cp s.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable s
Finally start the service:
sudo service s start