
Hello am trying to send a post request to my appwrite functions api server but am getting this error:
Access to fetch at 'https://[url_id].appwrite.global/' from origin 'http://localhost:3005/' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: 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.

Your function will need to send back the header to allow your client.


and how can i send back the header to the client if am using the appwrite Starter function template

because am trying to set the header like this:
res.setHeader('Access-Control-Allow-Origin', '*');
and am getting this error: TypeError: res.setHeader is not a function

It would be a parameter to the function: https://github.com/open-runtimes/open-runtimes/blob/a3f20033b642d75096bc9754301e6d1525cebd1e/runtimes/node-20.0/src/server.js#L79
Recommended threads
- I have an error oauth with Microsoft
invalid_request: The provided value for the input parameter 'redirect_uri' is not valid. The expected value is a URI which matches a redirect URI registered for...
- how many Teams can be created?
I am creating an app where I will let users create groups. This could mean there will be many groups created by user, to isolate those groups properly I am thin...
- React native app login via Safari
Hi! I deployed for debug my React Native app in web, chrome everythink works well but in safari on mac and ios I cant login. I found this one error in safari co...
