I am new to Ionic framework (with Vuejs) and trying to make simple Crud app. But due to CORS issues, i can't able to login.
Browser console show XMLHttpRequest at 'http://localproject.test/api/login' from origin 'http://localhost:8100' has been blocked by CORS policy
I tried a lot of different solutions, without success Please help.
Thanks in advance.
If your app will be running on browser, use Proxy server.
Example: I want to post to http://localproject.test/api/login.
In
package.json
, I will add this line:"proxy": "http://localproject.test/api"
My POST request in Login component: