Serve local directory using Rack::Static

Recently I needed to test compatibility of a static webpage on Internet Explorer running on VM. It’s not really handy to sync the files after every single change, so I decided to run a simple webserver to provide access to the directory via HTTP. After struggling with 5 liners using WEBrick, my friend came up with the idea to use Rack::Static to do so. You can simply save the following code in config.ru file in the directory that you want to publish, and run rackup command to start the server (don’t forget to gem install rack before).