Casey DeLorme

serve

I often found myself working with folks who had limited back-end development knowledge.

Regularly these folks would complain about the difficulties of setting up a web server, such as apache or nginx, to test front-end code locally.

I spent roughly 30 minutes and wrote the first draft of a file server written for the sole purpose of locally testing.

The current version is under 30 lines of code (<80 if you count tests), allows the port to be changed via an environment variable, and will launch the site in the web browser.

This is by far the coolest tiny utility I have written, and while it certainly does not compete with something like nginx, it’s something you can just run and it works with literally zero configuration.

written on 2017-04-13