0

I'm new to node.
First I programmed a project that worked properly through console.
When I tried to make a web interface i faced different problems.
I used request npm package, when i tried to do so webpack won't import package to my project.
I tried to used different packages such as browser-request then i faced this message in console:

access to XMLHttpRequest at 'http://google.com/' from origin 'http://localhost:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I use cheerio@1.0.0-rc.2 and after-load need cheerio 0.20.0 , can't use that npm package.

My question is how can i get response code and source body from a url that my web user fill in browser?

Any other proper way to do that?

mihai
  • 37,072
  • 9
  • 60
  • 86
movAhed
  • 73
  • 1
  • 2
  • 14

1 Answers1

0

You are probably dealing with Cross-Origin Resource Sharing issues when running from localhost.

See this answer for possible solutions.

mihai
  • 37,072
  • 9
  • 60
  • 86