Skip to content
A sample node.js application using Express and Socket.IO built for Valio Con 2012.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
README.md
package.json
server.js

README.md

Building a Node.js App Using Express & Socket.IO

Here are some notes for my node.js workshop that you can use to follow along during and after the talk. Together, we'll build the server-side portion of a simple app called UserSpy using two popular node.js frameworks: express and socket.io.

Prerequisites

1. Install Node.js

The very first thing you'll want to do is install node.js on your local machine. Click the Download button on the website and choose the correct package for your platform.

2. Verify Installation

Ensure installation was successful by running node -v in a terminal. It should print out the version of node installed.

3. Install Nodemon

When developing node apps, you'll need to restart the app after every change. To automate this, install nodemon:

sudo npm install nodemon -g

From now on, instead of running apps using node you can use nodemon to get the auto-restart functionality.

Grab the Project

1. Make a Clone of the Userspy Repository:

git clone https://github.com/ammmir/userspy
cd userspy

2. Install Dependencies:

npm install

Although node has a rich core API, there are thousands of modules available at the official npm registry. A node app declares its module dependencies in a file called package.json.

3. Finally, Run the App:

nodemon server.js

Start Coding

If you followed all the steps above, you'll see something like this:

5 Jun 15:11:57 - [nodemon] v0.6.12
5 Jun 15:11:57 - [nodemon] watching: /Users/amir/src/userspy
5 Jun 15:11:57 - [nodemon] starting `node server.js`
UserSpy server started.

Now we're ready to start coding :)

You can’t perform that action at this time.