Here are some good gist's how the set up a websocket server incl. serving an webapp for that:
- https://gist.github.com/johnhunter/1456613 (express.js + socket.io)
- https://gist.github.com/damianb/4190316 (expressjs + socket.io + passport + redis)
Here are also similar questions:
- How to use ExpressJS and Socket.io on a same port?
- Express & Socket.io Route parroting/copying/sharing