
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
- Server Error when Pushing a Function
Get this ambiguous error when trying to push my function, it's TypeScript using NodeJS 18 ``` ? Which functions would you like to push? get-grades (get-grades)...
- Hola equipo de soporte,
Hola equipo de soporte, Estoy desarrollando una Function en Appwrite Cloud con Node.js 22 y el siguiente package.json: { "name": "upload-whitelist", "type"...
- Function running in cloud but not locall...
Hi everyone, I have an appwrite function which is on python3.12 runtime. I have a library (hnswlib) which builds wheels during installation. This works on appwr...
