O'Reilly logo

Mastering Web Application Development with Express by Alexandru Vlăduțu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the V8 debugger

V8 comes with a debugger that can be accessed from outside the process by using a TCP protocol. Node comes with a built-in client for the debugger, but we can also add external tools to connect to the debugger—such as node-inspector (https://www.npmjs.org/package/node-inspector).

Creating our buggy application

To showcase the debugger, we will create a sample Express application that contains a bug (not that hard to spot actually). The application will have three endpoints:

  • /: The main page will assign a random name and e-mail to the session in case they don't already exist, or redirect the user to /whoami if they are already set
  • /whoami: This is used to check the name and e-mail stored in the session
  • /refresh: This destroys the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required