Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can you use node-inspector to debug a node.js app running with foreman

I have an node.js application that I can debug with node-inspector running:

node --debug app.js

But I want to use foreman to start my application so it will load environment variables in the .env file. Like so:

foreman start

Is there a way to run the app with foreman and also use node-inspector? I tried:

foreman start --debug

but didn't have any luck with that.

Thanks.

like image 635
jcarrig Avatar asked Mar 30 '12 16:03

jcarrig


2 Answers

Why not use node --debug app.js in your Procfile

like image 145
mihai Avatar answered Sep 16 '22 23:09

mihai


If you only are concerned with environment variables, you may also consider using:

foreman run node --debug app.js

The run command isn't exactly the same as start; instead of firing up your entire app, it only runs a command in the context of your app's Heroku environment. So this may or may not work depending on your situation (if you have supporting workers, etc.).

like image 41
George Pantazis Avatar answered Sep 20 '22 23:09

George Pantazis