I know that title of this question makes no sense, because client does not share anything, it requests. But, say I want to write a RSS reader as an excercise. So I would store all my data on client in IndexedDB (or localstorage), and I want to fetch some streams. So I do for example
fetch('https://bunyk.wordpress.com/feed/')
But wordpress.com is not in my controll, and it gives me error
No 'Access-Control-Allow-Origin' header is present on the requested resource.
I could avoid that error by using {mode: 'no-cors'}
, but in that way I'm not able to get contents too.
Is there any way to make it work, or I need to write and host some thin backend that proxies that requests and adds 'Access-Control-Allow-Origin'
header? (Probably such proxy already exists somewhere?) Or could I use something from Progressive Web Apps abilities, like Service Workers? Or should I use something like Electron or Cordova? What I wish to do, is to make my app work on mobile too.