I am using version 1.3.7 and facing with an issue when I try to run a swift function. Is there any example function/documentation about how to deploy a swift function? It was quite challenging for me to adding to the env and downloading the openruntimes swift image by myself.
I believe the syntax for 1.3x was like this:
func main(req: RequestValue, res: RequestResponse) throws -> RequestResponse {
let payload = req.payload.isEmpty ? "No payload provided. Add custom data when executing function" : req.payload
let secretKey = req.variables["SECRET_KEY"] ?? "SECRET_KEY variable not found. You can set it in Function settings."
let randomNumber = Double.random(in: 0...1)
let trigger = req.variables["APPWRITE_FUNCTION_TRIGGER"]
return res.json(data: [
"message": "Hello from Appwrite!",
"payload": payload,
"secretKey": secretKey,
"randomNumber": randomNumber,
"trigger": trigger,
])
}
I have the following linking error
@Binyamin do you have any idea? π
How are you deploying the function?
I am deploying manually with an entry point
Can you try with appwrite-cli
Recommended threads
- apple exchange code to token
hello guys, im new here π I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...