From 64598cf20af7b20464fab9ecf4cdb1f0ede4eca6 Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Mon, 17 Feb 2014 11:56:03 -0500 Subject: [PATCH] Update socket.io guide to include server.listen() --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb9b5f379e..59f9ae785a 100644 --- a/README.md +++ b/README.md @@ -774,7 +774,16 @@ io.sockets.on('connection', function(socket) { }); ``` -We are done with the server-side business. +One last thing left to change: +```js +app.listen(app.get('port'), function() { +``` +to +```js +server.listen(app.get('port'), function() { +``` + +At this point we are done with the back-end. You now have a choice - to include your JavaScript code in Jade templates or have all your client-side JavaScript in a separate file - in `main.js`. I will admit, when I first started out with Node.js and JavaScript in general,