But the whole value of SimpleHTTPServer is its ubiquity.
And if you need speed and are someone with go installed, you could write a one line main anyway:
In that case I can just run an nginx though.
That’s absolutely true. I would run nginx or a one line main before I would clone a repo, build it, and so on.
If you have the go toolchain installed, this is a single ‘go get’ and you have it in your path forever. I found it particularly useful for looking at python coverage results on a headless machine. SimpleHTTPServer simply couldn’t serve the page as it had too many subcomponents; serve-dir served it up in milliseconds. nginx requires writing a config, setting it up as a daemon, and likely running via sudo (or figuring out some way to redirect the logging to non-root locations).
All my bet is that native http.FileServer of golang is cache aware which is not the case of SimpleHTTPServer
http://chneukirchen.org/dotfiles/bin/nginx-here (doesnt work with 1.8 yet).
It was simply faster for me to code one than find one on the interwebs.
It seems he agrees :)
What’s funny is I found that line on the interwebs, it used to be an example on the net/http godoc.
I use http-server for this purpose. You install it with npm (Node) instead of go. It’s just as simple: http-server or http-server --help.