假设系统已经安装了node.js,首先需要安装node-inspector,执行
$npm -g install node-inspector
以使用pomelo为例
$pomelo init pomelo_demo
更改 game-server/config/servers.json
{"id": "connector-server-1", "host": "127.0.0.1", "port": 3150, "clientPort": 3010, "frontend": true}
===》
{"id": "connector-server-1", "host": "127.0.0.1", "port": 3150, "clientPort": 3010, "frontend": true, "args": "--debug=9876"}
or
{"id": "connector-server-1", "host": "127.0.0.1", "port": 3150, "clientPort": 3010, "frontend": true, "args": "--debug-brk=9876"}
$cd game-server & pomelo start
$cd web-server & node app
$node-inspector --web-port=8081
--debug-brk 区别在于,启动调试后,会在入口点断点
--web-port=8081 可更改监听端口
阅读(2746) | 评论(0) | 转发(0) |