
Hi, What is the best way to create a function ? I've create a function with the cli, upload it to my server with the cli, it crash, I examine log, i fix, reupload, it run, etc. But If I want to test it before deploy how can I do that ? Any tips or best practice ?

Hi, @Meldiron has an example in Deno listed here: https://github.com/Meldiron/tmstats/blob/master/backend/functions/nadeoAction/src/test.ts. The idea is to have a test file that imports entrypoint of the function, and executes. It fakes req and res objects, providing test data for variables, payload.. Response is faked by printing into console.
Recommended threads
- custom requirements.txt file
How do I specify a custom requirements.txt file when creating a serverless function through the Appwrite console?
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
- ❗[Help] Function stuck in "waiting" stat...
Hi Appwrite team 👋 I'm trying to contribute to Appwrite and followed the official setup instructions from the CONTRIBUTING.md guide to run the platform locall...
