Welcome Guest, Not a member yet? Register   Sign In
Access-Control-Allow-Origin [SOLVED]
#1

(This post was last modified: 09-19-2019, 06:20 AM by carmine.milieni.)

I have create RESTfull server in codeigniter 4, my ci4 app It is performed on fake virtual host, example api.fakedomain.it, if i execute request from my REST client don't have problem, but if execute request call from my angular app to http://localhost:4200/ , i receive on browser debug console this error

Code:
login:1 Access to XMLHttpRequest at 'http://api.fakedomain.it/api/v1/authentication' from origin 'http://localhost:4200' 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.

How can i configure CI4 ? thanks
Reply
#2
Smile 

I Ask and I resolve!
I have written solution in short article on my blog for this problem

See https://carminemilieni.it/2019/09/19/res...igniter-4/

Thanks.
Reply
#3

i'm using reverse proxy to solve this problem.
Reply
#4

(09-19-2019, 04:02 AM)titounnes Wrote: i'm using reverse proxy to solve this problem.

You could describe your solution?
I am a full-stack developer in Italy.
[[url=https://carminemilieni.it]carminemilieni.it

[Image: https://carminemilieni.it/wp-content/upl...ieni-1.png]
Reply




Theme © iAndrew 2016 - Forum software by © MyBB