Node.Js is a simple technology to host a webserver.
I wanted to share the steps to enable debugging on a Windows computer.
To debug we will use a very powerful tool : node-inspector. Node inspector is a web-hosted debugger which communicates with your application thanks to WebSocket and will allow you to create breakpoints, update your application in live to improve your capacity to solve the issues you can have.
- Download and install Node.JS.
- Type : npm install -g node-inspector to install node-inspector
- Open a first Powershell and type : node-inspector
This will start a server that you can access by default at : http://localhost:8080/debug?port=5858
- Open a second Powershell, go to your application folder and type : node –debug-brk .\app.js
This will start your application in debug mode.
- Go to : http://localhost:8080/debug?port=5858, the application is stopped by default at the start of your app.js application.
Use the resume button to launch your application
- Go to : http://localhost:APP_PORT to access your application