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
- Sometimes this function shows an error l...
1. Synchronous function execution timed out. Use asynchronous execution instead, or ensure the execution duration doesn't exceed 30 seconds.\nError Code: 408 2...
- Custom Topic sent from Function (with sc...
Can I send a message on a custom topic? So clients can subscribe to them?
- Function scheduling is not functional on...
Hello everyone! I'm using Appwrite Cloud and I have a function that runs every day at 00:00 UTC. Preciously it worked fine, but it didn't fire last night and i...