refactoring routes.js to use config.rootPath