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
- self-hosted auth: /v1/account 404 on saf...
Project created in React/Next.js, Appwrite version 1.6.0. Authentication works in all browsers except Safari (ios), where an attempt to connect to {endpoint}/v1...
- My account is blocked so please check an...
My account is blocked so please unblock my account because all the apps are closed due to which it is causing a lot of problems
- Applying free credits on Github Student ...
So this post is kind of related to my old post where i was charged 15usd by mistake. This happens when you are trying to apply free credits you got from somewh...