so I read the docs and you need to define a main method. I assume it's similar like python so it works on CLI.
Try doing something like this below if you want. Just make sure to create a main method and do stuff in it.
https://appwrite.io/docs/functions
def main(req, res)
payload =
!req.payload.empty? ? req.payload :
'No payload provided. Add custom data when executing function.'
secretKey =
req.variables['SECRET_KEY'] ||
'SECRET_KEY variable not found. You can set it in Function settings.'
randomNumber = rand()
trigger = req.variables['APPWRITE_FUNCTION_TRIGGER']
return res.json({
:message => 'Hello from Appwrite!',
:payload => payload,
:secretKey => secretKey,
:randomNumber => randomNumber,
:trigger => trigger,
})
end