Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug server side code in a Meteor app

I have been struggling to debug the server side code in my app. For the client, the browser debugger in chrome or firefox work like a charm but it is more complicated for the server

like image 558
Micha Roon Avatar asked Feb 16 '13 11:02

Micha Roon


People also ask

How do I run a meteor server?

meteor run You can use the application by pointing your web browser at localhost:3000. No Internet connection is required. This is the default command. Simply running meteor is the same as meteor run .


1 Answers

So here is how I managed it for meteor 0.5.6

there is no need to tinker with the run.js anymore

install node-inspector https://github.com/dannycoates/node-inspector

create an environment variable export NODE_OPTIONS='--debug'

run meteor or mrt command. It should tell you something like debugger listening on port 5858

Once the debugger is listening, you can start node-inspector and point your browser to Visit http://127.0.0.1:8080/debug?port=5858

I had a lot of fun with it :-)

For meteor 1.2.x and onward, everything is packaged in. Simply run meteor debug and connect to the provided url

like image 133
Micha Roon Avatar answered Oct 11 '22 02:10

Micha Roon