Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource

Was working on a small blog type website in free time, heard MongoDB is decent for storing text content. Looked into it, went through CRUD and everything. When finally used it, ran into this error. I'm trying to store article content (title, date, author, body, img urls etc..) as json on atlas and using nth child to use it on webpage. When i use fetch in my js file to get data from the link i got from mongoDB connect page, it returns this error 'Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at mongodb+srv://user:**passwordhere*@cluster0.hpg7xhg.mongodb.net/article?retryWrites=true&w=majority. (Reason: CORS request not http)' what to do
2 Replies
b1mind
b1mind2y ago
Look up CORS mongo DB The error is clear, it's an important topic you need to understand
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server