如何在 WebStorm 中同时调试服务器和客户端? [英] How do I debug server and client simultaneously in WebStorm?
问题描述
我有一个运行服务器并发送 index.html 的 node.js 应用程序.index.html 与服务器交互.
I have a node.js app that runs a server and sends index.html. The index.html interacts with the server.
我想调试完整的应用程序,但是当我调试应用程序时,WebStorm 只调试服务器.
I want to debug the complete app, but when I debug the app, WebStorm only debugs the server.
这在 WebStorm 中是否可行?如果没有,是否有其他工具可以做到这一点?
Is this even possible in WebStorm? If not, are there other tools that can do this?
推荐答案
在 Node.js 运行配置,浏览器/实时编辑 选项卡,指定您的服务器的 URL,勾选 启动后 和 JavaScript 调试器复选框 - 使用此配置启动节点服务器后,将启动客户端调试器,以便您可以使用单个运行配置同时调试两者.
In the Node.js run configuration, Browser/Live Edit tab, specify the URL of your server, tick both After launch and with JavaScript debugger checkboxes - client-side debugger will be launched once you start your node server with this configuration, so that you will be able to debug both simultaneously, using a single run configuration.
另见 https://www.jetbrains.com/help/webstorm/debugging-javascript-in-chrome.html#debugging_js_on_external_web_server 一些关于调试在浏览器中运行的客户端代码的提示
See also https://www.jetbrains.com/help/webstorm/debugging-javascript-in-chrome.html#debugging_js_on_external_web_server for some hints on debugging client-side code run in browser
这篇关于如何在 WebStorm 中同时调试服务器和客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!