How i can fix the CORS Isses??
dipaksarkar opened this issue · 2 comments
I'm trying to create an app by vue js but getting CORS problem.
to fetch at 'https://sandbox.sslcommerz.com/gwprocess/v4/api.php' from origin 'http://localhost:8080' 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
@DepokSarkar this is just a wrapper around the SSLCommerz API, even if I set it to no-cors mode, I don't think this is a good practice as it exposes your store_id and store_passwd to javascript. You should make this API call from a backend server and if your vue.js application is serverless, look into Azure Functions/AWS Lambda functions. I am closing this issue.
Thanks! I have a server and I was thinking about it.