Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do i debug a node.js app using heroku foreman?

i am new to heroku and node.js. i have a small node.js app which i can start and run successfully on my local machine using FOREMAN from the heroku toolbelt. i do not understand how to best debug the app, though.

i see that there is an eclipse debugger for node.js as well as the node-inspector project. but i cant seem to make these work with FOREMAN.

foreman start

if it is not possible to debug an app started by foreman, what is the purpose of foreman?

like image 577
Paul Avatar asked Mar 18 '26 07:03

Paul


1 Answers

Just an addition, your Procfile could look like this:

web: node web.js
webDebug: node --debug-brk=5858 web.js`

So to start debugging you just call foreman start webDebug, you could call the configuration however you want.

The debugger will listen on port 5858 and you'll have to call your app from http://localhost:5100 instead of http://localhost:5000.

like image 169
Irina Anastasiu Avatar answered Mar 20 '26 19:03

Irina Anastasiu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!