I set a breakpoint on a line of a server module, created a server REPL, called the function with the breakpoint, but the IDE didn’t stop at the breakpoint.
(The function with the breakpoint is called by an HTTP endpoint.)
Is it possible to use the debugger from the REPL?
AFAIK, you can debug HTTP endpoints with Anvil’s Interactive Debugger. You can set breakpoints in your server-side code (even inside HTTP endpoint handlers), pause execution, inspect variables, and use a REPL to interact with your app’s state.
If you just want to test server logic in isolation, the Server Console gives you a REPL instance where you can import your server modules, call functions, and play with your code in real time.
Hi @stefano.menci,
Yes, you can use the debugger with HTTP endpoints, but the debugger only fires in your debug environment. If you hit the HTTP endpoint of a published environment, it won’t stop.
Use the Publish UI to get a URL for your debug environment, then hit an HTTP endpoint there, and you should see your code stop in the debugger!
2 Likes
My question wasn’t worded well because it was actually two questions:
- Can I debug HTTP endpoints?
- Can I debug functions called from the server REPL?
You answered the first one. Since you didn’t mention the second, I’m assuming the answer there is no.