WebFund 2013F: Tutorial 4: Difference between revisions
Created page with "'''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 <tt>form-demo..." |
|||
Line 4: | Line 4: | ||
==Browser-based debugging== | ==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 <tt>node debug app.js</tt>, for example. Will stop on first line of file; type <tt>c</tt> to continue. Add a <tt>debugger;</tt> statement to get the debugger to stop at a given line of javascript. Type <tt>repl</tt> 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 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. |
Revision as of 13:42, 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 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.