Solution 1 - you need to change your backend to accept your incoming requests
Solution 2 - using Angular proxy see here
Please note this is only for
ng serve
, you can't use proxy inng build
Solution 3 - IF your backend accepts requests from a wildcard domanin like *.testdomain.example
then you can edit your hosts
file and add 127.0.0.1 local.testdomain.example
in there, then in your browser instead of localhost:4200
enter local.testdomain.example:4200
Note: the reason it's working via postman is postman doesn't send preflight requests while your browser does.
No comments:
Post a Comment