Unable to create a request to the movies because of lack of "Access-Control-Allow-Origin" header
dwnppoalt opened this issue · 6 comments
Describe the bug
Whenever I try to create a request from the movie providers, the error occurs.
Steps to reproduce
Here is the code I tried
const movies = new MOVIES.FlixHQ()
var data = movies.search(search.value).then(data => {
console.log(data);
})
Expected behavior
Something like the documentation should what've occured
Actual behavior
I got this issue at the browser's console tab
Access to XMLHttpRequest at 'https://flixhq.to/search/five-nights-at-freddy?page=1' from origin 'https://motorola-scholarships-past-regime.trycloudflare.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
Additional context
I'm new at JavaScript, TypeScript, and other languages this is involved in. So it might just be me. Either way, how do I fix it? Thank you! :D
Its not just you, I'm having the same issue.
Hello, I tried using the API and host it on Vercel, and it now works for me. However, due to the fact that I'm using the API for a Discord App, I no longer use it. If you want, I'll give you a link to the API that I deploy, but it might not be up for long.
Hello, I tried using the API and host it on Vercel, and it now works for me. However, due to the fact that I'm using the API for a Discord App, I no longer use it. If you want, I'll give you a link to the API that I deploy, but it might not be up for long.
So I have to host my own version of the API then? Ok, I can do that.
I was initially using the typescript library and that's where I was getting the error like yourself.
Hello, I tried using the API and host it on Vercel, and it now works for me. However, due to the fact that I'm using the API for a Discord App, I no longer use it. If you want, I'll give you a link to the API that I deploy, but it might not be up for long.
So I have to host my own version of the API then? Ok, I can do that.
I was initially using the typescript library and that's where I was getting the error like yourself.
That worked for me. You can use what the documentation says.