moved process events out of webserver.js and into app.js
require db
moved middleware out of webserver.js and into middleware.js