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
- AI feature by functions?
I'm creating a website where, in short, users can index certain genealogical content. In connection with the development of AI, I was thinking about introducing...
- Unknown usage from one of my database
I need support help. For more than 2 weeks, i didn't make any requests to my database, but I have noticed huge amount of reads and writes requests: Around 8000...
- AppwriteException: Missing required para...
I'm using node-appwrite sdk to retrive the documents. Example my code on pic, was define collectionId but error is still. Why?