add socket.io code in app.js, and migrate bin/www to app.js