1. Install wskdebug
npm install -g @adobe/wskdebug
2. Setup the Docker locally. You can download it from https://docs.docker.com/docker-for-windows/install/ and once restart your system after installation.
3. Now we need create the Adobe IO’s image locally to execute out actions. Use below command to create your local image in docker:
wskdebug --inspect-brk=11932 <ACTION NAME> <FULL PATH TO THE SOURCE FILE> -l
Now lets setup our VS Code to access this image and start our debugging:
1. Open VS Code.
2. Go to debug section on left.
3. Click on create launch.json (Selecting Node.js preview)
4. Now add the below configuration to the created launch .json file.
"configurations": [
{
"type": "node",
"request": "launch",
"name": "wskdebug ",
"runtimeExecutable": "wskdebug",
"args": [ "", "${workspaceFolder}/", "-l" ],
"localRoot": "${workspaceFolder}",
"remoteRoot": "/code",
"outputCapture": "std"
}
]
Now we are done creating the debugger for our IO actions locally. Just start your debugger locally and once you see below message then start your execution of code and check for logs.
Ready, waiting for activations! Use CTRL+C to exit
Reference: https://code.visualstudio.com/docs/editor/debugging#_launch-configurations
Reference: https://code.visualstudio.com/docs/editor/debugging#_launch-configurations
No comments:
Post a Comment
If you have any doubts or questions, please let us know.