I'm trying to add a accountCreate mutation from my local environment to my cloud project.
I keep getting the following error.
Access to XMLHttpRequest at 'https://cloud.appwrite.io/v1/graphql/mutation' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Project hostname is set to localhost
My NextJs middleware follows NextJS CORS middleware template: https://nextjs.org/docs/app/building-your-application/routing/middleware#cors
with
const allowedOrigins = ["https://cloud.appwrite.io", "http://localhost:3000"]
export const config = {
matcher: "/:path*",
}
This should be working... Any ideas why it doesn't?
I am logging the Project ID in the client setup in the code, and it matches the one in the cloud.
have you added a platform for localhost in the appwrite console?
Yes I did!
Recommended threads
- Hi Appwrite Support Team,My project has ...
Details: Project ID: 69a69f6f00113ed0e8e4 Region: SFO (sfo.cloud.appwrite.io) Error Response: Affected: ALL endpoints — Functions, Databases, Storage, Health, ...
- Sudden CORS Errors - Domain hasn't Chang...
I have an Appwrite project with two web apps configured, the first one has the hostname `*` and the second one I just added to test if it could fix the issue wi...
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...