WebFund 2013F: Tutorial 4: Difference between revisions

From Soma-notes
Line 17: Line 17:


==Tasks==
==Tasks==
* Observe the request and response for the app's home page (http://localhost:3010).
* Observe the request and response for the app's home page (http://localhost:3010). Look at both the network panel (load the page ''after'' selecting the network panel) and the HTML DOM view (Inspector/Elements)
* 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.
* 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.
* Look at other web pages!

Revision as of 14:57, 27 September 2013

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). Look at both the network panel (load the page after selecting the network panel) and the HTML DOM view (Inspector/Elements)
  • 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.
  • Look at other web pages!