Notes on programming by Daniel Mendel

Dumbwaiter v0.0.1

Mar 4th, 2013

I’ve recently found myself doing a lot of experiments in HTML that are only composed of client-side code. The trick is that to properly test them, you have to serve the pages through a host of some kind – anything that you open directly using the file: protocol runs into security measures that prevent the page access to certain types of assets and requests.

In the past I’ve either launched Chrome with --allow-file-access-from-files and used the file: protocol, or served the files through a local Apache or Nginx server. Since I’m lazy, I decided these options were too much work and that instead I wanted a simple CLI to spin up small servers for any local directory.

This morning I wrote dumbwaiter, a tiny, 11 line npm module for doing just that by using the connect.static middleware.