restructure server.js
chat server