WebFund 2013F: Tutorial 4

From Soma-notes
Revision as of 10:56, 27 September 2013 by Soma (talk | contribs) (→‎Tasks)
Jump to navigation Jump to search

This lab is not yet finalized

In this lab you will be learning the basics of debugging Node-based web applications. All of the following assumes you have form-demo setup and running from Assignment 1.

Browser-based debugging

  • Firefox: Tools->Web Developer->Toggle Tools
  • Chrome/Chromium: Tools->Developer Tools

Select Network tab to see HTTP traffic Select Inspector (Firefox) or Elements (Chrome/Chromium) to see HTML document

Node debugging

Node has a built-in debugger. Start in by running node debug app.js, for example. Will stop on first line of file; type c to continue. Add a debugger; statement to get the debugger to stop at a given line of javascript. Type repl to drop into a read-eval-print loop where you can evaluate JavaScript statements in the current context. Ctrl-C to get out of the REPL.

Brackets and Theseus

Tasks

  • Observe the request and response for the app's home page (http://localhost:3010).
  • Observe the contents of the form submit POST request: how much data is sent to the server? Observe it both from the browser side (to see what is sent) and inside of node, particularly where the POST results are returned.