CORS generally occurs due to one of the following reason: - Hitting the Server from a localhost file(like localhost:4200/index.html) - Hitting an External API which is not hosted on your server i.e. (api.fontawesome.com/login) - Hitting an Internal API from your App. - Hitting an API which is on https from an http origin.
To solve the CORS issue you can use the CORS header called Access-COntrol-Allow-Origin and set it to * to allow it from any origin like this: Access-Control-Allow-Origin: * This way it will allow it to access any URL from any Origin. Refer to below article for more info: https://daveceddia.com/access-control-allow-origin-cors-errors-in-angular/ On Saturday, January 25, 2020 at 11:08:12 AM UTC+5:30, Felipe Miranda wrote: > > Hi, i am consuming rest services from an external server, in develop i > solve the Cors error with a proxy.conf.json file. How i solve this problem > when i pass to production? -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/724816ff-5d47-4f5c-af95-6804f46f55d6%40googlegroups.com.
