This error has to do with the API link used, it is wrong from what can see on the browser console error. You are accessing the frontend from this link https://requiomarket.my.id which is correct, and the frontend is trying to communicate with the API on the same link https://requiomarket.my.id/api/auth/login which is not correct.
There are 2 ways to set up your frontend and API.
Main domain and subdomain: The frontend will be on the main domain and API will be on the subdomain. You cannot put both on two different domains or subdomains, you will get the cors error. This method was used in the tutorial above.
Note: When using HTTPS for the frontend HTTPS must be used for the backend link, and both SSL on this link must be valid. And if you use HTTP for the frontend, HTTP must be used on the backend.
If you still donât get it, try rewatching the video again.
i used your 1st way⌠i used sub domain called âapi.requiomarket.my.idâ which is my domain is ârequiomarket.my.idâ. but i will try with 2nd way. thanks for your response, willvin
[EDIT]: i have try again and still the problem is CORS policy
âAccess to XMLHttpRequest at âhttps://backend.requiomarket.my.id/api/auth/loginâ from origin âhttps://requiomarket.my.idâ 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.â
Iâm very frustrated in my trial period with RADSystem 8.1.8, since I canât solve my publishing error, Iâm facing different errors trying to publish it on a local network with XAMPP and an external hosting service too. I followed your video step by step, and research on google, but I didnât find a solution. Iâm pretty sure my error is with the API path, but I donât know how to make it works.
Changing different API paths, I have obtained different errors, such as âAccess to XMLHttpRequest at ââ from origin âurlâ has been blocked by CORS policy: No âAccess-Control-Allow-Originâ header is present on the requested resource.â
or simply the 404 error âFailed to load resource: the server responded with a status of 404 (Not Found)â.
Iâm puzzled, because in the case of the URL for the API in runtime, it specifies something like â⌠//index?page=1&limit=10 n.htmlâ And sure enough that folder of each page, does not exist in the API path. That already makes me doubt if it is a problem of how I am doing the publication or it could be a bug of RADSystem.
Iâm using PHP-Laravel Bkend FW with Quasar UI FW.
I hope this message finds you well. I am writing to seek your assistance with an issue I have been experiencing with an application generated by RadSystems. The application uses Laravel 10 as the backend and Vue Prime as the frontend.
When running the application in production mode on a shared server with Apache or in a local Apache environment on Windows, I encounter a CORS issue specifically when trying to access the /api/account route. This problem does not occur when running the application in a local development environment using php artisan serve.
Error in the browser console:
Access to XMLHttpRequest at âhttp://api.nodolabs.local/api/account/â from origin âhttp://nodolabs.localâ has been blocked by CORS policy: Response to preflight request doesnât pass access control check: Redirect is not allowed for a preflight request.
I have tried various solutions, including configuring CORS middleware in Laravel and adjustments in the Apache .htaccess file, but the issue persists.