Posting to API's from online Repl's

Posting to API's from online Repl's
0

#1

Hey Everyone,
I am teaching an intermediate JS class and currently we are having all of our students setup local servers so they can post to API’s since you can’t post on things like CodePen or others that I know of. Is there a way to bypass this? We would prefer to not make our students setup a local server yet if possible and just post from something like CP. All ideas welcome!


#2

What do you mean by this?


#3

I’m just talking about a POST request to an API. You can do some GET requests without a cors error, but most POST requests throw an error that’s usually a CORS error.


#4

This might work for you if you’re using codepen. Seems simple too with no real setup:


#5

Thanks! Looks like crossorigin.me is down a lot, but I searched from this and got some other options. I may end up setting up my own server and having my students pass their api calls through that since I can setup allowed origins that way.


#6

Setting up your own proxy sounds like a great solution - would be more reliable than crossorigin.me and you have full control over the server. Sounds like a fun class!