如何在Meteor应用程序中调试服务器端代码 [英] How to debug server side code in a Meteor app

查看:134
本文介绍了如何在Meteor应用程序中调试服务器端代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力调试我的应用程序中的服务器端代码。对于客户端,chrome或firefox中的浏览器调试器的工作方式就像一个魅力,但是对于服务器来说更为复杂。

解决方案

所以这里是我如何管理它的流星0.5.6



没有必要修补run.js了



安装节点检查器 https://github.com/dannycoates/node-inspector



创建环境变量 export NODE_OPTIONS =' - debug'



运行流星 mrt 命令。它应该告诉你像调试器一样侦听端口5858



调试器侦听之后,您可以启动节点检查器,并将浏览器指向访问http://127.0.0.1:8080/debug?port=5858



我有很多乐趣: - )


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

解决方案

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

这篇关于如何在Meteor应用程序中调试服务器端代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆