theglasspenguin @theglasspenguin

i’m working on something in javascript that uses apis, and every time i try to use that api it doesn’t work and throws the error that looks like Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://coolapi.thing.

can someone help me plz

Aug 19, 2022, 3:03 AM
5

comments

how I do it is have a piece of code in my express server that forwards requests

this ^^

cors doesn’t apply on the backend, as you can’t csrf there

i don’t really have a backend though…

The API needs to allow your origin (the domain/subdomain)