Hello Assignment

Video

Overview

The purpose of this assignment is to start learning about Node.js, which is an execution environment for Javascript designed for building network applications such as Web applications. This course will show you how to build Web applications using Node.js and CouchDB.

Assignment folder

Create folder ~/405/hello to store the results of your work on this assignment. When you are finished with this assignment, this folder should contain the following files.

In README.md add a statement that describes the status of your work on this assignment.

Install Node.js

Install Node.js if not already available on your system.

Node.js is installed on the lab computers in JB 358 and 359.

When you install Node.js, the Node Package Manager (NPM) also gets installed along with it. NPM is used to install publicly available modules (Node.js libraries). We will not use npm in this course.

A build of Node.js is available for the Rasberry Pi from the Node.js website. See Raspberry Pi and Node.JS: Basic Setup for help getting Node.js installed and configuring the system to start an instance of Node.js when the system starts.

Read

Read Wikipedia's entry on HTTP.

Having a thorough knowledge of HTTP is essential for most software developers and system administrators.

Read About this Documentation from the Node documentation.

Create and test your first server

Read the Synopsis page and do the experiment described in it.

After running the server program, visit the following URL to test: http://127.0.0.1:8124/.

IP address 127.0.0.1 is a special address that represents the localhost, which is the computer you are working on.

Try using the string localhost in your browser as an alternative to 127.0.0.1; this might be easier for you to remember.

Change the message in example.js from Hello World to Goodbye World and then test your modifications.

Change the port number from 8124 to 5000 and then test this change.

Add the files README.md and example.js to the hello folder and commit and push changes.

cd ~/405
git add hello/README.md
git add hello/example.js
git commit -m "completed hello"
git push