refactor server.js into config files