I'm trying to test endpoints of my Node.js app running on localhost:3000 making requests from my Flutter web app running on localhost:5000 and I get the infamous 'No 'Access-Control-Allow-Origin' header is present on the requested resource.' error. So I'm trying to use local-core-proxy..
In my package.json scripts I added "proxy": "lcp --proxyUrl http://localhost --port 3000" .. and if I got right this should generate localhost:3000/proxy domain which I 'd use for my request as:
final Uri uri = Uri.http('localhost:3000',
'/proxy/api/products');
But when making the request I still get the error:
Access to XMLHttpRequest at 'http://localhost:3000/proxy/api/products' from origin 'http://localhost:5000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Am I missing to set something?
Many thanks for this package.
I'm trying to test endpoints of my Node.js app running on localhost:3000 making requests from my Flutter web app running on localhost:5000 and I get the infamous
'No 'Access-Control-Allow-Origin' header is present on the requested resource.' error. So I'm trying to use local-core-proxy..In my package.json scripts I added "proxy": "lcp --proxyUrl http://localhost --port 3000" .. and if I got right this should generate
localhost:3000/proxydomain which I 'd use for my request as:But when making the request I still get the error:
Am I missing to set something?
Many thanks for this package.