Hey gang, in this websockets tutorial I’ll be showing you how to get a very simple express app up and running on Node.js, ready for working with websockets.

+ Repo –
+ Atom editor –
+ Download Node –
+ –
Related tutorials:



============== The Net Ninja =====================

For more front-end development tutorials & to black-belt your coding skills, head over to – or

================== Social Links ==================

Twitter – @TheNetNinja –


  1. after installing nodemon, then typing "nodemon index", it didn't work, any idea what i did wrong? my also appears to not be working since the browser tells me "unable to connect to server", could this be linked to the nodemon thing?

  2. for those searching for the CSS

    body {
    font-family: 'Nunito';

    h2 {
    font-size: 18px;
    padding: 10px 20px;
    color: #575ed8;

    max-width: 600px;
    margin: 30px auto;
    border: 1px solid #ddd;
    box-shadow: 1px 2px 5px rgba(0,0,0,0.05);
    border-radius: 2px;

    height: 400px;
    overflow: auto;
    background: #f9f9f9;

    #output p{
    padding: 14px 0px;
    margin: 0 20px;
    border-bottom: 1px solid #e9e9e9;
    color: #555;

    box-sizing: border-box;
    display: block;
    padding: 10px 20px;

    input {
    padding: 10px 20px;
    box-sizing: border-box;
    background: #eee;
    border: 0;
    display: block;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #eee;
    font-family: Nunito;
    font-size: 16px;

    background: #575ed8;
    color: #fff;
    font-size: 18px;
    border: 0;
    padding: 12px 0;
    width: 100%;
    border-radius: 0 0 2px 2px;

  3. I can't get past the 'nodemon index' part of the tutorial.
    I get this error in cmder:

    C:UserskdsilvaDesktopKDCodingWebsocketsTutorial ([email protected])
    λ nodemon index
    [nodemon] 1.11.0
    [nodemon] to restart at any time, enter `rs`
    [nodemon] watching: .
    [nodemon] starting `node index index.js`
    throw er; // Unhandled 'error' event

    Error: spawn cmd ENOENT
    at exports._errnoException (util.js:1018:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:367:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

  4. Thank You Sir for all this tutorials. Just wanted to know how can i create a same chat app on godaddy. I have my website running there and i wanted to create a chat app on my site.

  5. hey ninja, whenever I type nodemon index the console says: bash: nodemon: command not found.

    but I added a line in my pacakge.json file ("start": "nodemon index.js")
    and type npm start then it works
    can you tell me whhy this happened?


Please enter your comment!
Please enter your name here