【问题标题】:How can i debugging my adonis ( nodejs ) framework APIs?如何调试我的 adonis ( nodejs ) 框架 API?
【发布时间】:2020-03-08 23:12:08
【问题描述】:

我只是 NodeJS 中 adonis 框架的初学者 但我在 laravel 和 lumen 框架方面有很好的经验

在 laravel 和 lumen 框架 API 中,我使用 dd() dump and die 来调试我的应用程序

但是在 AONIS 框架中,我不知道如何调试我的 API code

对于 IDE = 我正在使用 Microsoft Visual Studio (VS Code)

【问题讨论】:

标签: node.js debugging visual-studio-code adonis.js dd


【解决方案1】:

阅读:https://code.visualstudio.com/docs/nodejs/nodejs-debugging(来自@damitj07)

总结:

你需要创建新的 lauch.json 像:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "node",
            "request": "launch",
            "cwd": "${workspaceFolder}/yourApp",
            "runtimeExecutable": "npm",
            "runtimeArgs": [
                "run-script",
                "debug"
            ],
            "port": 9229
        }
    ]
}

并在您的 package.json 中添加新脚本,例如:

"scripts": {
    ...
    "debug": "node --nolazy --inspect-brk=9229 server.js"
  },

【讨论】:

    猜你喜欢
    • 2020-10-20
    • 1970-01-01
    • 2018-11-12
    • 1970-01-01
    • 2021-10-31
    • 2017-03-10
    • 1970-01-01
    • 2012-03-02
    • 2019-05-27
    相关资源
    最近更新 更多