Rank 1: Thread
Hey Guys!
I am just tryed to use AppWrite for the first time and I am getting an error. But I can't figure out the problem. I have installed and set up appwrite as the documentation says but when I use the CDN in an HTML file it given an error: Access to fetch at 'http://localhost/v1/account' from origin 'null' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'http://localhost' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. This happens when I try to run this file: ```
AppWrite Test
const { Client, Account, ID } = Appwrite;
const client = new Client();
client
.setEndpoint("http://localhost/v1")
.setProject("642a8fce24cb7b6b4e6e");
const account = new Account(client);
// Register User
account
.create(ID.unique(), "me@example.com", "password", "Jane Doe")
.then(
(response) => {
console.log(response);
},
(error) => {
console.log(error);
}
);
</script>