live instance at - https://chatsserver.herokuapp.com
Steps to run it locally -
- Install NodeJS and npm
- Run 'npm install -d', It'll create the node_modules(dependencies required) folder from package.json
- Run program 'node app.js'
Heroku specific changes in the app(in app.js) -
You can force your app to run on a localhost port, just change
var port = process.env.PORT || 5000;
server.listen(port);
to
server.listen(your_port);
Finally instantiate socket with your localhost address(in index.html)
var socket = io.connect('http://localhost:your_port');
Your app will also run fine without these changes.