stolen from: https://github.com/itang/gohttp with a few additions. If the path you specify for serving is a file this will create a tmp folder and serve up a copy of just that single file. I find this useful for when I want to share a file with co-workers but don't want to share the other files in the directory.
It also generates a url to your machine [http://your.ip:port] and copies it your clipboard for easy pasting in your favorite chat client or whatever.
- Linux requires
xclip
orxsel
to be installed
go get -u github.com/devonmoss/serve
go install github.com/devonmoss/serve
$ serve --help
$ serve
Serving HTTP on 192.168.1.103 port 8080 from "/home/workspace/work" ...
$ serve -d /home -p 9000
Serving HTTP on 192.168.1.128 port 9000 from "/home" ...
Distributed under the Apache License Version 2.0.