#Step by Step Remote Debugging SAP CAP Applications with-in Business Application Studio.
Note: Wanted to keep my blogs are simple and point to the needs 🙂 Not adding much theory part 🙂 please refer the below blogs for about more theory and step by step approach.
1. Login to cloud foundry.
cf login -a <api-url> --sso
2. Connect to a Cloud Foundry Application Instance Using SSH.
cf ssh-enabled <<deployed-capapplication-service>> or cf enable-ssh <<deployed-capapplication-service>>
3. Enable the Node.js Inspector for Remote Debugging on Running CAP Application.
cf enable-ssh myapp
4. Re-Start Running CAP Application
cf restart <<deployed-applicaion-service>>
5. Enable Port Forwarding to Cloud Foundry.
cf ssh <<deployed-application-service>>
once connected , you will be in an interactive SSH Session.
5. Attach a Node.js Debugger to a Process Running on a Cloud Foundry Application Instance.
To enable debug mode for a running Node.js process, you'll need to determine its unique process ID (PID). On Linux and Unix-like environments, you can use the ps command to obtain this information.
ps aux
Once the PID of the Node.js process running the application is known, you can use the kill command to send a debugging signal to it. The Node.js runtime activates the inspector protocol when it receives a usr1 signal.
kill -usr1 189
6. Enable Port Forwarding to Cloud Foundry, ( VIMP ) Command, Run In New Terminal
cf ssh -N -L 9229:127.0.0.1:9229 <<deployed-application-service>>
7. Add Business Application Studio debug configuration.
{
"name": "Remote Debugging",
"port": 9229,
"request": "attach",
"type": "node",
"localRoot": "${workspaceFolder}",
"remoteRoot": "/home/vcap/app"
},
8. Run the CAP Application.
Thank You.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |