Skip over the banner and go to the main content

Simple Static File Server

by Kelly A. McCauley on October 30, 2013

The other day I was working in a virtual machine running a Linux distribution. It wasn't running a display server and I needed to look at some HTML documentation. The documentation utilized a lot of JavaScript, so using something like Lynx was out of the question. I wanted something that I could use to temporarily serve the documentation pages.

I ended up using a Node.js package called http-server. It is a no-frills static http server. As far as I'm aware of it doesn't handle https connections.

Since I already had node, I installed it ...

npm install -g http-server

... and ran it.

cd /usr/share/doc/foo-app/docs
http-server -a 192.168.123.45

Finally I pointed my browser to 192.168.123.45 port 8080 and I was reading the docs. It turns out that the docs were not helpful, but getting to the point where I could read them was easy.

Go to the 99 kayaks front page