I'd like some help on how reach appwrite (api) from a function on my local dev machine. Essentially can anyone help me with the endpoint to use for the SDK Client in my local function? That is for
final client = Client().setEndpoint('https://localhost/v1')
I've tried:
- My local ip
http://192.168.1.11/v1
- appwrite service name (from compose)
http//:appwrite/v1
- Localhost
http://localhost/v1
(doesn't work obviously)
But from this message it seems Steven got it to work but I just can't seem to figure it out. This is frustrating because I know I'm missing something simple here.
https://discord.com/channels/564160730845151244/1094376924882685962/1094515291117064263
The local IP should work...maybe use https? What's the error you get?
Also, are you using windows?
I'm using Linux. I've tried both http and https.
Initially I was getting this error when I was using https://localhost/v1
:
AppwriteException: , Connection failed (0) #0 ClientIO.call (package:dart_appwrite/src/client_io.dart:233)
<asynchronous suspension>
#1 Databases.listDocuments (package:dart_appwrite/services/databases.dart:1016)
<asynchronous suspension>
#2 getClassIdIfExists (package:starter_template/main.dart:92)
<asynchronous suspension>
#3 main (package:starter_template/main.dart:44)
<asynchronous suspension>
#4 Future.any.onValue (dart:async/future.dart:615)
<asynchronous suspension>
type 'Null' is not a subtype of type 'int' of 'statusCode'
#0 main (package:starter_template/main.dart)
<asynchronous suspension>
#1 Future.any.onValue (dart:async/future.dart:615)
<asynchronous suspension>
But after updating it to the local ip I'm getting Execution timed out.
How'd you install docker?
Using the docker run command from the docs for v1.4.13
Docker, not Appwrite
I copied the command from appwrite's docs
Here's the command, still have it in my history:
docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="upgrade" \
appwrite/appwrite:1.4.13
Btw what did you mean by host.docker.internal
working for you? Did you set that as the _APP_DOMAIN_FUNCTIONS?
Recommended threads
- HTTP POST to function returning "No Appw...
Hi everyone, I’m running into an issue with my self-hosted Appwrite instance. I’ve set up my environment variables (APPWRITE_FUNCTION_PROJECT_ID, APPWRITE_FUNC...
- Can't add dart 3.5 runtime
Modified the `.env` to enable dart 3.5 runtime on my self-hosted instance but still can't find the runtime when creating a new function. I manually pulled the i...
- How to verify an user using AppWrite Fun...
I have seen similar questions but none whose solutions serve me. I have a function to verify a user with their secret and their id: https://blahblah.appwrite.gl...