Im starting a function, and when I try to parse the req.body it just doesnt work
I attached some images of my code
For example if I log(bodyParsed.userId) is just undefined
Am i doing something wrong?
Perhaps it's already parsed so you don't need to parse it again
appwrite automatically parses the req.body?
I know the error seems very dumb, but it gets very strange...
When I delete node-appwrite from the dependencies on the package.json and comment the import { Client } from 'node-appwrite', out of nowhere everything works, I can extract the userId from the req.body and the log(bodyParsed) shows as a JSON
when the node-appwrite from the package.json and import { Client } from 'node-appwrite' is present in the code it is impossible to parse the req.body, It remains as a string and recently the entire function stopped working for no reason with an error of:
Multiple internal curl errors has occurred within the executor! Error Number: 111. Error Msg: Connection refused\nError Code: 500
What could cause it?
Im using "node-appwrite": "^9.0.0", i will attach a photo of my package.json, my code and the new error that appears in the console in case that helps...
how are you executing the function?
Do you mean where I am running it from? I am using the appwrite interface, I will attach an image
This is the exact same both times you executed?
I managed to solve the error, I tried many things and I no longer know which one worked
but now it works, thanks steven
[SOLVED] function req.body problem
Recommended threads
- AppwriteException - Transaction with the...
I am using "node-appwrite" module and I have successfully created transaction id but when passing it to tablesDB.createRow function with some other required dat...
- Cannot create cloud function due to this...
As I try to deploy a new function to Github I get this error message: ``` Unable to clone code repository: fatal: ' ' is not a valid branch name hint: See `man ...
- How to use TS for creating appwrite func...
I was making a few appwrite functions but on doing the appwrite init setup process i always got main.js. Is there any way i can use TS?