theglasspenguin — 8/19/2022, 3:03:21 AM

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

♥ 2 ↩ 1 💬 5 comments

comments

cst1229:

I usually just use https://allorigins.win.

8/24/2022, 8:25:12 AM
lily:

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

8/19/2022, 7:30:26 AM
oren:

this ^^

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

8/19/2022, 7:20:37 PM
theglasspenguin:

i don’t really have a backend though…

8/19/2022, 7:24:21 PM
grippins:

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

8/19/2022, 3:55:05 AM