Search code examples
node.jsdebuggingnode-inspector

Debugging with node-inspector: Cannot GET /


I am running a Nodejs server with an application which I want to debug. In order to achieve this using node-inspector I run the app as follows:

node-debug server.js

Unfortunately I can not access the webserver via URL anymore. Visiting http://127.0.0.1:8080 results in

Cannot GET /

However if I start the application the usual way with

node server.js

everything is fine (except for the fact that I can not debug). But I can access http://127.0.0.1:8080.

The '/' request is also not logged so it seems that it never reaches the server.

Hence the problem I have is: I can access the remote debugger via http://127.0.0.1:8080/debug?ws=127.0.0.1:8080&port=5858 but I can not start debugging because I can not trigger any action on the webserver via URL.

Oh and the debugger is not paused or anything. I skipped the first break point.


Solution

  • I resolved the problem by choosing a different port than 8080. It seems like the debugger uses this port. I was not aware of that because this port was familiar to me as I used it for my application.