Divided server.js into modules and connected the app to mongodb.