Moderator
So you basically need to put payload between {}
Votes
0
Replies
24
Participants
Unknown
Messages
25
Moderator
So you basically need to put payload between {}
Moderator
Also make sure it fills all required data, since if it's not filled, a document will not be created
Rank 3: Container
Done
Rank 3: Container
It's not working
Do you have set permissions in the collection?
e.g. go to the collection you want to insert the document in and give 'Any' permission to read and insert and then see if you are able to create the document
Moderator
If having token, that's not required
Admin
what's the error? also, instead of console.log(error), would you please change it to console.log(error.toString())?
Rank 3: Container
There is none it's just going to show that response and there is no doc made.
Admin
Did you try again after switching to err.toString()
Rank 3: Container
this
Admin
nice. did you use localhost as your endpoint?
Rank 3: Container
hopefully no
Rank 3: Container
Admin
would you please check the APPWRITE_FUNCTION_ENDPOINT variable?
Rank 3: Container
sure
Rank 3: Container
this code is working locally when I run directly this module on a server, but on appwrite function its not running :(
Rank 3: Container
yup that was the error
Rank 3: Container
but shouldn't
APPWRITE_FUNCTION_ENDPOINT already have the endpoint details?
Rank 3: Container
Steven any idea how to skip the build step for ts npm run build before uploading the build. Like its too tedious to first build and then ship.
Rank 3: Container
It working now!
Admin
We're addressing this in the near future
I still have the problem with APPWRITE_FUNCTION_ENDPOINT. I tried localhost (should not work in docker environment) and the ip of my local computer. i still get Error: getaddrinfo ENOTFOUND hostname
Okay after set api key and endpoint everything works.
[SOLVED] Not able to create document with function