Node

Login to the desktop in the lab, do all of your work there! Do not log into cslinux. Try to avoid looking at the lecture examples as much as possible.
  1. Get hello-https.js running on your lab system. Run with node hello-http.js and then use the following URL in your browser... http://localhost:8000. Kill node with ctrl-c.
  2. Unscramble guessGame1.js so that it responds to requests like http://localhost:8000/?guess=4 and plays the guess game with secret number 5. Hint: Take a look at hello-https.js
  3. Now add a web page with a form so that the user can submit the form to play the game. For example...

    Your last guess was small
  4. Unscramble guessGame2.js so that each user has their own session. Examine the cookie sent to each user. If you want to play your neighbours game, you can (if a firewall is not blocking) http://dh2020pcXX.utm.utoronto.ca:8000
  5. Take the changes made to guessGame1.js and add them to guessGame2.js so that it has a real user interface (web form).

Hints