Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Dart Functions upgrade for Appwrite Functions v2 #313

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

lohanidamodar
Copy link
Member

No description provided.

To package this example as a cloud function, follow these steps.

```bash
$ cd demos-for-functions/dart/file_backup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check this command in all readmes, should be V2

To package this example as a cloud function, follow these steps.

```bash
$ cd demos-for-functions/dart/file_backup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check with Eldad. Do we call it V2? I think we use naming convention Gen2 (generation 2)

Comment on lines +33 to +34
$ cd ..
$ tar -zcvf code.tar.gz file_backup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please test this once? I remember reports from Discord that people didn't get function working when tarring from outside of the folder. They had to tar it from inside and use . to get it working.
Could be fake alert, but lets please check.

Comment on lines +37 to +41
* Upload the tarfile to your Appwrite Console and use the following entrypoint command

```bash
dart main.dart
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entrypoint, not Entrypoint command
main.dart, not dart main.dart.

Same goes for all readmes.

* Upload the tarfile to your Appwrite Console and use the following entrypoint command

```bash
dart main.dart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In opr-examples we always put code in a source folder. Do we want to do it here for consistency? So the file would be lib/main.dart: https://github.com/open-runtimes/examples/blob/main/dart/convert-phone-number-to-country-name/lib/main.dart


## 🎯 Trigger

Head over to your function in the Appwrite console and under the Settings Tab, enable the `storage.files.create` event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Event were refactored. Can we update these notes?


Since we are retrieving an url from the API, the GIPHY API is more than enough for our needs.

## ☁️ Create a new Function
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add this title to all readmes, or remove it from here

Comment on lines +37 to +40
..setEndpoint(endpoint)
..setProject(env['APPWRITE_FUNCTION_PROJECT_ID'])
..setKey(env['APPWRITE_API_KEY']);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not experienced with flutter, but are there supposed to be 2 dots?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants