tl;dr How can I launch a Swift function on Appwrite?
I'm currently trying to launch a function in a runtime that is not supported by Appwrite Cloud at the moment (Swift) but can't seem to figure it out. I also can't find docs that show the complete flow.
What I've done so far
- Setup Appwrite locally w/ Docker
- Created an account via localhost
- Created a project
- Logged in via CLI
- Linked directory with project
- Ran
appwrite functions create --functionId 'tryfunctions' --name firstFunction --runtime 'swift-5.8'
This is the error I receive:
✗ Error Invalid `runtime` param: Value must be one of (node-16.0, php-8.0, ruby-3.0, python-3.9)
I understand that Appwrite Cloud only supports those runtimes as listed in the docs here: https://appwrite.io/docs/products/functions/runtimes but those same docs list Swift as a supported language.
I've also looked under the Development docs https://appwrite.io/docs/products/functions/development but still couldn't figure out how the Swift (or an other alternatative) runtime fits into the flow and how the intial function is generated, if at all.
If existing docs exist, or any other resources, I'd grately appreciate the help.
p.s. if the resources don't exist, I will create them this week
You'll need to enable the runtime: https://appwrite.io/docs/advanced/self-hosting/functions#functions
perfect! Let me try that. I obviously didnt look closely enough at the docs
Thanks Steven
For anyone viewing this thread, you can add a runtime that isn't supported by Cloud by updating the .env file in the appwrite directory on your machine (it should be located in the directory wherever you downloaded the Appwrite CLI). Once located, update the runtimes variable with the runtime(s) you're interested in using. Here's an example of what mine looks like:
_APP_FUNCTIONS_RUNTIMES=swift-5.8
You can find a list of runtime names in the doc I referenced in the original post.
Recommended threads
- How to send Webhooks to internal network
When saving the URL for sending Webhooks, Appwrite checks if it's a valid external domain name so entering internal IP address or docker hostnames won't save th...
- Collections list not showing up when try...
I'm trying to create new relationship attribute but both one way and two way relationship is not showing up collections list to connect with my relationship att...
- Self hosted project based backup
Is there a native way to perform a project-level backup in a self-hosted instance, instead of backing up the entire Docker instance? If not, I would like to off...