I have been trying to create a microservice application with Metronic 8.1.2 as a backend Laravel demo 7 and Vue JS demo 7 as a frontend. When I deployed it on the live server using Apache2, it showed an error "Access to XMLHttpRequest at 'http://api' from origin 'http://url' 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 changed some configuration settings but the error persists.
vue.config.jsmodule.exports = {
publicPath:
process.env.NODE_ENV === "production" ? "/" : "/",
devServer: {
proxy: {
'^/api': {
target: 'http://api',
ws: true,
changeOrigin: true
}
}
}
};
Hi,
Could you please specify on which URLs your front-end and back-end are served?
Also please attach an example of your request.
Regards,
Lauris Stepanovs,
Keenthemes Support Team