首页 > Web开发 > 详细

[Debug] How to Debug a NestJs Backend using the Chrome Dev Tools

时间:2019-11-04 17:05:12      阅读:104      评论:0      收藏:0      [点我收藏+]

TO debug NestJS code with Chrome dev tool, we can run:

node --inspect-brk dist/rest-api/src/main.js

 

TO make it easier for us running this later, we can do:

"start:debug": "tsc-watch -p tsconfig.build.json --onSuccess \"node --inspect-brk dist/rest-api/src/main.js\"",

 

After running this script, you cannot see the endpoint running, this is becasue we need to attach chrome dev tool.

To do that, open a new tab in Chrome,

chrome://inspect

THis helps to attach the chrome dev tool to our NestJS backend.

 

Then we can reopen the endpoint in tab, we can do the normal debugging as we did in Front end.

 

[Debug] How to Debug a NestJs Backend using the Chrome Dev Tools

原文:https://www.cnblogs.com/Answer1215/p/11792532.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!