NG6-starter icon indicating copy to clipboard operation
NG6-starter copied to clipboard

CORS Proxy

Open AndyMBridges opened this issue 7 years ago • 1 comments

Hi Guys,

I'm having a CORS issue when pulling the flickr api using http.get.

(http://api.flickr.com/services/feeds/photos_public.gne)

Can someone please tell me how to integrate a proxy to bypass this? Would it be within the gulp file or the webpack setup?

Thanks, Andy

AndyMBridges avatar Sep 26 '17 11:09 AndyMBridges

Hey,

You can add extra middleware to browser sync server.

`import proxy from 'http-proxy-middleware'; // see how to use here https://github.com/chimurai/http-proxy-middleware`

middleware: [
proxy(`http://api.flickr.com/services/`, assign({}, proxyConfig)),
]
)

samithaf avatar Nov 16 '17 23:11 samithaf