-
Notifications
You must be signed in to change notification settings - Fork 142
Dart Functions upgrade for Appwrite Functions v2 #313
base: master
Are you sure you want to change the base?
Conversation
…-for-functions into dart-functions-v2
To package this example as a cloud function, follow these steps. | ||
|
||
```bash | ||
$ cd demos-for-functions/dart/file_backup |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)
$ cd .. | ||
$ tar -zcvf code.tar.gz file_backup |
There was a problem hiding this comment.
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.
* Upload the tarfile to your Appwrite Console and use the following entrypoint command | ||
|
||
```bash | ||
dart main.dart | ||
``` |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
..setEndpoint(endpoint) | ||
..setProject(env['APPWRITE_FUNCTION_PROJECT_ID']) | ||
..setKey(env['APPWRITE_API_KEY']); | ||
|
There was a problem hiding this comment.
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?
No description provided.