Streaming live at 10am (PST)

CORS No 'Access-Control-Allow-Origin'


#1

Hi,

So I’m trying to output some data from an API, however, the request is getting blocked.

Is there a way around this?

The page is http://common-energy.webflow.io/partners


#2

You have to use a server-side app to access the API. There is no way around it.


#4

So what I’m trying to achieve here with the GET request isn’t possible with Webflow at the moment?


#5

@benbagley im not 100% sure what you want to do but i have been doing tihis when i was testing vue.js and i did work fine. You have to be sure that your site and the CDN is using the same security http or https.


#6

Ok so because the staging .webflow site isn’t using http that could be the underlining issue?


#7

Could be, but you han add https// before your link in the browser
Ther is a Chrome plug in that overrides the CORS problem. I did use that When i was testing some APIs not supporting https


#8

Yeah still not showing anything

From what I can tell the ids are all correct and following the code in the custom code on that page.

Still getting

So I’m thinking it’s Webflow?


#9

It could also be that the staging site you are suing is just HTTP and not HTTPS like an actually hosted site would be with a SSL turned on.

Although I am not sure how the API works in this manner tho.


#10

Here is a post a created a while ago

Try to use the CORS plug in


#12

So there’s a CORS plugin for Webflow, I’m not trying to build an external API myself to connect to webflow, I’m just trying to grab data from a GET request.


#13

The CORS plug-in is a Chrome plug-in for testing only to bypass the CORS problem.

Calling external API is not a problem. You have to be sure that you use a client that can be included via a CDN since you can’t add somthing Local When using Webflow hostning. If you read My post you can se that i was using buse.js and axios


#15

Ok so I tested the site in Opera, Chrome and firefox. The numbers are only showing up in chrome. Any ideas?


#16

Did you solve your CORS problem? Wich HTTP client are you using?


#17

Well, no.

I tested the site on my PC using Chrome, Opera and firefox. Only Chrome is showing the data.

Tested on my mac, the same applies but I have to overwrite CORS using the plugin.

Obviously, I can’t expect the user to have the plugin that would be absurd. So I’m not sure what to do here, keep the data as is and just hope it works when I push to a custom domain or just insert static content.


#18

I do have a question, If you are calling a REST API you need a client. Wish client are you using


#19

All I’m using is Webflow, I have the code in custom code in the page settings.

The code here was given to be my the client.


#20

Can you send me your code and a link to the site with dokumentation about the API you are calling. I can’t look at it tonight but can take a look tomorow. Ok?

Janne-w@adbutveckling.se