just for the notebooks on this site that pull data from elsewhere
could be rate and size limited so we don’t abuse
https://cors-anywhere.herokuapp.com/
related posts:
I think the main issue with the way observable sets up origin for code cell is that unlike the notebook itself, which has https://beta.observablehq.com origin, code cell frames are pinned to custom user static content.
See origin request header generated from a fetch() cell call:
[observable-fetch-headers]
Therefore, even if you have control over the server hosting a data API you’d like others to use on observable, you can’t simply add beta.observable.hq.com to the ‘Access-Control-Allow-Orig…
The only good viable ‘quick ’ solution I found, other than hosting your own proxy on heroku or in other clouds, was to deploy your own CORS proxy on glitch as described in this notebook:
Short version: \`import { soFetch } from '@alecglassford/so-fetch'\`, then \`soFetch(urlWithoutCORS)\` ✨ There's a lot of neat stuff on the web, but as the Introduction to Data notebook mentions, you're not going to be able to load resources whose...
It’s better than using heroku cors anywhere since glitch allows up to 4K requests/hr till 429. see: Glitch: The friendly community where everyone builds the web
I put a short fetch.js tester notebook here:
for a full-blown fetcher see:
https://beta.observablehq.com/@bumbeishvili/fetcher-usage Fetcher is convenient wrapper around different libs, which are responsible for data loading and parsing This notebook in some cases, uses (cors-anywhere.herokuapp.com) proxy server , which...
still a robust cors-anywere proxy for just observable notebooks question remains.
would love to know if you are planning to provide it in the future?
4 Likes