Hello team, i am trying to deploy a bot localy, to test some design changes for the interface, i have followed the guide for setting everything up, but when i try to run the bot localy, i get this error:
Access to XMLHttpRequest at ‘localhost:8545/api/users/sts’ from origin ‘http://localhost:8545’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
I understand i have to make some changes, which i have done, but its still not working, the changes i have made are the following:
At the users.js file i addded :
res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Headers', 'Authorization, X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Allow-Request-Method'); res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, DELETE'); res.header('Allow', 'GET, POST, OPTIONS, PUT, DELETE');
Thanks in advance for your help