#CORS issue with cloudlfared tunnel
30 messages · Page 1 of 1 (latest)
Check this:
https://appwrite.io/blog/post/cors-error
in this tab?
Also, make sure to set the env var to your domain
Nope
ah okay, I'll take a look ty
ah okay, do you mean the ip address of the server hosting my domain?
127.0.0.1
No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
actually there wasn't a header present this time
Hmmm interesting. What's the code?
@sage quest Wouldn't the hostname need to be "api.apoth.dev" for the Platform?
Nope. That's the appwrite hostname, not the frontend hostname to my understand
a snippet from the auth.js I use to log users in
Yes, it's not pointing to appwrite correctly. Make sure you have only one DNS A record pointing to your appwrite instance for that subdomain
will give that a wirl
still having the same issues, could anything else be causing my endpoint to be broken?
An A record pointing to your appwrite instance IP address
oh so an A record in my cloudflare dns for api.mydomain.com to 127.0.0.1:80?
Yes, if that's your appwrite instance IP address
But I think that's a local IP address?
sorry to trouble but how would I find that ip address? I've been under the assumption it was just a variation of localhost:80 since that's the port I use to access it locally
If you're developing locally, use your PC IP address as the endpoint. Once you deploy, you should host the appwrite server in an VPS or port forward your computer and then set the domain with an A record pointing to your home IP address or your VPS IP address
really feels like just using the cloud service would be easier atp 😅