How to remotely debug a node.js application on heroku?

I am currently creating node.js chatbot, which I then deploy to the hero. The application uses Web sites, which must be with a public URL, accessible by servers. Therefore, starting the server locally on my computer will not work. Is there a way to remotely debug my application? Any tips?

+5
source share
3 answers

I would like to use a tool to connect public urls to an instance of your application running locally.

Option 1: ngrok

Ngrok will be easy

Option 2: reverse ssh tunneling

If you have access to any server accessing the Internet with ssh and admin privileges to enable the GatewayPorts yes sshd configuration, you can do this using remote ssh tunneling. For instance:

 ssh -n -R 8080:localhost:3000 myserver.example.com 

Allows Web sites sent to http://myserver.example.com:8080 to tunnel to a local application listening on port 3000.

More information about ssh tunnel can be found here.

+2
source

You can really debug webcams on your local computer using a free proxy service like ngrok .

If you want to debug it on Heroku, you can view your logs in real time using heroku logs --tail or use the addon service in which the logs are stored.

+1
source

Found a simpler solution.

Install the LogDNA add- LogDNA , and then run the application and view the error stack trace.

when you see the error and in which line it happened, it is quite easy to find the problem.

+1
source

All Articles