Skip to content

Instantly share code, notes, and snippets.

@jhnns
Last active November 16, 2018 12:05
Show Gist options
  • Save jhnns/e9f8abe880f3bff66477ed17aeff0186 to your computer and use it in GitHub Desktop.
Save jhnns/e9f8abe880f3bff66477ed17aeff0186 to your computer and use it in GitHub Desktop.
How to debug a Node.js server written in TypeScript running in Docker
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Server in Docker",
"port": 9222,
"timeout": 10000,
"stopOnEntry": true,
"cwd": "${workspaceFolder}/app/server", // the root where everything is based on
"localRoot": "${workspaceFolder}/app/server", // root of all server files
"remoteRoot": "/server", // workspace path which was set in the dockerfile
"outFiles": ["${workspaceFolder}/app/server/dist/src/**/*.js"], // all compiled JavaScript files
"sourceMaps": true,
"internalConsoleOptions": "neverOpen"
}
]
}
@jhnns
Copy link
Author

jhnns commented Nov 16, 2018

I had to use .json5 to allow comments in the JSON file. The filename should actually be launch.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment