Extracted settings, db connection, and routes from server file to clean up.