[SOLVED] How can I integrate server side function calls such as createDatabase or createCollection
- 0
- Self Hosted
- Flutter
- General
In general this is not recommend as you'll expose an API key in your app, the best approach would be to use cloud-function for that matter.
If you do want to do so then you'll need to add the dart_appwrite packages and import it like so
import 'package:dart_appwrite/dart_appwrite.dart' as server_side;
Then use it like so,
server_side.Client client = server_side.Client()
.setEndpoint('http://[HOSTNAME_OR_IP]/v1')
.setProject('5ff3379a01d25')
.setKey('cd868c7af8bdc893b4...93b7535db89')
.setSelfSigned();
server_side.Users users = server_side.Users(client);
You need to do it that way because you two packages with same class names.
while trying to create a function using the appwrite cli, appwrite init function, im having an issue where it isnt showing dart runtime and online it shows a solution to enable a variable in the .env file in appwrite folder but i cant find where the folder is
I have installed appwrite using docker at localhost
@Binyamin
The .env is an hidden file
Where is your docker-compose.yml located?
im not sure of that, I dont have much knowledge about docker
this it the first time im using it for appwrite
That file and the .env should be placed in the folder you've ran the install command inside appwrite folder
found it
it was inside the windows/system32/appwrite
thank you
I added dart-2.12 to teh _APP_FUNCTIONS_ENVS and _APP_FUNCTIONS_RUNTIMES and restarted the container and im still unable to see dart runtime
@Binyamin sorry for disturbing you continuously 😓
How've your restarted the docker?
docker desktop or docker container?
restarted the container
How've you done this
docker-compose up -d using this and later restarting it from the desktop console
Mmm
Can you change the dart-2.12 to dart-2.17
And then rerun the docker compose up -d
okay ill try
that worked
thanks a lot
<:appwritefire:823999000330895380>
[SOLVED] How can I integrate server side function calls such as createDatabase or createCollection
Recommended threads
- RowList: The value of total is coming as...
RowList: The value of total is coming as a String, so it throws an error because it’s not parsed into an int. Error: TypeError: \"37\": type 'String' is not a ...
- 408 Timeout / Curl Error 7 in Executor w...
Hey everyone, I am losing my mind over a routing loop/timeout issue on a fresh self-hosted setup. I have a single Linux VPS (IP: 45.141.37.105) and one domain (...
- functions returning error 401 in local
I updated to 1.9.0, and the functions that used to work fine in 1.8.1 are now giving me a 401 error. I can't seem to find a solution. If anyone is running versi...