Re:Nweb: a tiny, safe web server (static pages only)
by hcarvalhoalves on Monday March 31, 2014 @11:39PM
(#7506038)
Works fine for some tests, but it's single threaded. If you need concurrency:
[ Parent
| on HN ]
Re:Nweb: a tiny, safe web server (static pages only)
by deathanatos on Tuesday April 01, 2014 @03:07AM
(#7506593)
Perhaps, but the use case it usually finds is "I need a webserver, here. Now."
Python is nearly always installed, and that depends on nothing but the standard library. You can stick an alias in your dotfiles (I have, it's called "serve-this") and not have to worry about having twisted¹ getting to wherever your dotfiles get put. (I distribute my dotfiles over git/github, so it's really easy to move them around. More work to get Twisted.)
¹Or Ruby… or Go…
Re:Nweb: a tiny, safe web server (static pages only)
by hcarvalhoalves on Tuesday April 01, 2014 @10:08AM
(#7508247)
Twisted is pre-installed on OS X and various Linux distributions...
Re:Nweb: a tiny, safe web server (static pages only)
by stock_toaster on Tuesday April 01, 2014 @12:13AM
(#7506148)
or in go:
package main
import (
"flag"
"net/http"
)
var serveDir = flag.String("d", ".", "Directory to serve from")
func main() {
flag.Parse()
panic(http.ListenAndServe("127.0.0.1:8000", http.FileServer(
http.Dir(*serveDir))))
}