This uses some trickery to make it DRY across 'dev' and 'prod' deployments, which only need to change a few lines. I'm surprised it even works!