adonis ace debug vscode code example

Example 1: adonis ace debug vscode

// FOR AdonisJS 5 AND GREATER
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-node",
      "request": "launch",
      "name": "Debug Application",
      "runtimeExecutable": "node",
      "runtimeArgs": [
        "ace",
        "serve",
        "--watch"
      ],
      "internalConsoleOptions": "openOnSessionStart"
    }
  ]
}

Example 2: adonisjs vscode debugger

// FOR AdonisJS 4.1 AND LOWER VERSION
// in package.json add
...
  "scripts": {
    "dev": "adonis serve --dev --debug",
  }
...
// then create a launch.json file under .vscode folder in root
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Debug Application",
      "runtimeExecutable": "npm",
      "runtimeArgs": [
        "run",
        "dev"
      ],
      "port": 9229,
      "internalConsoleOptions": "openOnSessionStart"
    }
  ]
}
// then it is ready to run