In VS Code, you can create a debugger launch configuration for your API endpoint. Set the "request" attribute to "attach" and the "processID" attribute to the job ID of the production component that services your API. Set breakpoints and run this configuration. Then when a request arrives, you can debug the service and endpoints while viewing the REST request contents.
Here is a reference video; example starts at 4:00.
What exactly, do you want to debug?
A REST API call into a docker instance
Unfortunately, there is no simple way of any debug for any web requests. And it does not really matter in docker or not.
Studio too?
In a studio it is possible.
.png)
1. I put a delay of a few seconds in the service code.
2. Start the service
3. I find the required process, connect to it
BINGO!
that''s the way to go.
I typically use from Terminal
>SET ^GO=0
and in code
SET ^JOB($h)=$JOB FOR x=1:0 HANG 1 IF $GET(^GO) QUIT
and of course Studio to attach
or I use $system.CSP.Shell() as described here
Actually, this way may also work in VSCode as well. It does support Attach to a process.
Good News! I was just not sure. Not to speed fake news
In VS Code, you can create a debugger launch configuration for your API endpoint. Set the "request" attribute to "attach" and the "processID" attribute to the job ID of the production component that services your API. Set breakpoints and run this configuration. Then when a request arrives, you can debug the service and endpoints while viewing the REST request contents.
Here is a reference video; example starts at 4:00.
https://www.youtube.com/watch?v=diLHwA0rlGM
Classes extended from csp.rest class does not generate an objectscript jobid. So, is not possible debug rest services.
Good point. In the example I gave, the request is forwarded to a business process which has a job ID.
Yes, from Ensemble you have, but from csp.rest no. It is because web Gateway
This can be done using the Serenji extension. Free evaluation keys for Serenji's debugging features are available on request.
The steps are documented here. I demonstrated it on the main stage at Global Summit 2019 during a session hosted by @Jeff Fried but unfortunately the YouTube video of that session has since been set private (see item 10 at https://community.intersystems.com/post/intersystems-global-summit-2019-... for the link).
The Video is now available at https://www.youtube.com/watch?v=OjdXmtd6E_M
You use the VS Code REST Client extension to make the requests and to debug you simple click on the Debug with Serenji code lens.