When I debug my node rest api, I try to use node-inspector
node-inspector
node --debug server.js
This way I can debug my api using localhost:3000/api... If I use node-debug, there's no way. It doens't start port 3000.
However my code is ES6, so in my current debug my code is transpiled by Babel.
I've tried to use babel-node-debug but It seems too be the same situation I had with node-debug. I can see ES6 code, but I'm not able to debug through port 3000.
Any workaround?
The options for babel-node
(included in the babel-cli
package) are the same as for node
.
babel-node
babel-node --debug-brk=8010 test.js
node-inspector
node-inspector
node-inspector
URL, passing the same port as a query parameterhttp://127.0.0.1:8080/?port=8010
I have tried this and it works well for me.
Disclaimer - I found this information here: https://github.com/CrabDude/babel-node-debug/issues/6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With