Can't test anvil.http using uplink

Hi,
I’m trying to use uplink to test my code locally, mainly because getting server debug logs is so painfully slow.

This stopped working once i started using anvil.http in my local code; the interpreter says it can’t find the anvil.http library.

At this point i’m very hesitant to recommend anvil to anyone because debugging problems on the server is so painful. It takes ~5 minutes from an error to be able to reliably see the logs. This is painful. Am I doing something wrong?

When testing through the IDE, I never have to look at the app logs. I only need to check the app logs when I’m doing something that is hitting the app from outside the IDE (e.g. using it through the production URL, hitting an HTTP endpoint, etc).

If you’re in a situation where you’re testing outside the IDE, yeah, the app logs are painfully slow lately. That hasn’t always been the case, so I assume it’s something that’s being worked on. In the meantime, you could put a default error handler in and log messages to data tables.

The only thing you need to test online with the http endpoints is whether the arguments, authentication, etc are received correctly.

You can test that by returning a string that shows what has been received. This way the test is very fast, you can use curl or any python script on your PC to call the endpoint and print the returned string. No need to use uplink. Any change you do to the code is immediately live and you can test again. Basically return a string instead of printing it to the log.

The next step is checking if the whole endpoint does the right thing, and you can do that by creating a function that does what you need to do and testing that with uplink (in PyCharm for example).

At this point you have one function that defines the endpoint and receives what needs to be received and another that is able to process it. You merge the two in one and you get you working http endpoint.