WebFund 2016W: Tutorial 3

From Soma-notes
Jump to navigation Jump to search

In this tutorial you will be learning the basics of debugging Node-based web applications in the context of a simple web form application.

First download, unpack, and run form-demo. To run you just need to type bin/www (from the form-demo directory); the modules are included.

To see all debugging output, type DEBUG='*' bin/www. This will produce more output that what you want; if you just want to see the ones pertaining to this application, run DEBUG='form-demo*' bin/www

Once you have the application up and running you should do the following tasks.

References

These pages may help you with some of the specifics of this document:

There was additional information about the debugging in Tutorial 2.

Tasks

You need to do all of the following to get full credit for this tutorial:

  • Figure out what happens when you delete six distinct lines from the application of your choosing. In other words, delete a line, restart the web app, see what happened. You should delete at least one line from app.js, views/layout.jade, view/index.jade, and routes/index.js.
  • Add a debug statement to routes/index.js that says "Rendering the main page" every time the initial page (with the form entry) is loaded. The debugging info should only be output when an appropriate DEBUG variable is set. NOTE: You will need to use the debug module for this (which is for debugging output), not the node debugger (which is for setting breakpoints and inspecting the current state of a node application).
  • Change the output page views/index.jade to have a button saying "List People" that lists the people that have already been entered. Note that you should link to a page that is already in the code that does this!

If you finish all this, start working on WebFund 2016W: Assignment 3.