ferlores: there should be an npm module built on top of routes.js that handles this problem