eosasia / ping-eos

Implementing ping between EOS / React.js
85 stars 21 forks source link

Failed to load http://127.0.0.1:8888/v1/chain/get_code: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. #2

Open yangjm20 opened 6 years ago

yangjm20 commented 6 years ago

Failed to load http://127.0.0.1:8888/v1/chain/get_code: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. apigen.js:118 api error => http://127.0.0.1:8888/v1/chain/get_code {"account_name":"ping.ctr"} TypeError: Failed to fetch

BenHigh5 commented 6 years ago

I think you need to set your headers in your eos config file (config.ini) to allow all (or specified ips).

access-control-allow-origin = *

msj121 commented 6 years ago

Also make sure you look for your config.ini file is the right one. I was trying one found in ~/Documents/eos-wallet

For MacOS But you should actually be looking: ~/Library/Application\ Support/eosio/nodeos/config/config.ini