Learn how to control Node.js execution from the command-line using Node inspect client and repl.
- [Instructor] Node's inspector agent…can be used with many clients.…Let's start with Node's built in utility, Inspect.…To use Node Inspect, we'll first need to stop…the web service process using PM2 to prevent conflicts.…Then, we'll add a debugger statement…as a break point to our web app.…Finally, we'll start Node Inspect on our web server,…and use the commands line client to control the process.…Let's get started.…From Visual Studio Code, open up the terminal.…
I'm gonna tell PM2 to stop the web server by typing…PM2, stop web, and pressing return.…Note that the web status is now stopped.…Now there won't be any conflicts on the port.…From the editor, we're going to manually…add a break point to the code.…Open up servers, web,…and open App.js.…Scroll down to right before the 404 logger,…and add the following:…debugger, followed by a semicolon.…
Save the changes.…Switch back to the terminal, and then start the inspector.…Node inspect, and then we're gonna use the relative path,…./servers/web/index.js.…The inspector agent has been started and is listening,…
- Building a troubleshooting mindset
- Why measure performance?
- What's a microservice architecture?
- Managing microservices with PM2
- Effective logging strategies
- Debugging Node.js applications
- Benchmarking performance
- Profiling code execution
- Knowing what to optimize
Skill Level Intermediate
Node.js: Deploying Applicationswith Kirsten Hunter1h 24m Intermediate
Building RESTful Web APIs with Node.js and Expresswith Emmanuel Henri1h 40m Intermediate
1. Build a Troubleshooting Mindset
2. Introducing Microservices
3. Effective Logging Strategies
4. Debugging Node.js Applications
Debugging isn't just logging3m 51s
5. Measuring Performance
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.