Code related to the Node.js RD planned for March 22, 2012
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Node.js RD 2012-03-22

Instructions, code snippets, demos and labs for the Node.js RD held at the Crisp office in Stockholm on March 22nd 2012.



Lab 1 (Echo Query Parameter Web Server)

Really Old JavaScript RD might be helpful as a refresher, and this one.

Create a Web Server that responds with the query parameters passed as JSON strings. Example response:

$ curl -i "http://localhost:3000/?p=xxx&xxx=p"
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: keep-alive
Transfer-Encoding: chunked

{ p: 'xxx', xxx: 'p' }

Some hints can be found in labs/lab1-web-server/server.js.

Lab 2 (testing with nodeunit)

npm install -g nodeunit
cd labs/lab2-nodeunit
nodeunit test

Depending on your OS you may need to sudo (or equivalent) the npm install command.

Lab 3 (chat server)

Create a Chat Server where each socket is identified by an id of the form id-[count].

Possibly Helpful

  • net api
  • JavaScript is a dynamic language.

Lab 4 (web server with Express)

npm install -g express
mkdir labs/lab4-express
cd labs/lab4-express
express --help

Depending on your OS you may need to sudo (or equivalent) the npm install command.

Create a web application using the express executable, template engine ejs, no session support and plain css.

Lab 5 (

npm install -g
mkdir labs/
cd labs/

Create a browser based chat application using A starting point can be found in labsolutions/

Useful links