Hi, I’m trying to use the REST API option in a Vue app but I’m getting CORS error. The error that I’m getting says CORS header ‘Access-Control-Allow-Origin’ missing.
I try to set the allow_cors option with the following command bench config set-common-config -c allow_cors true but still getting the same error.
What should I do to get REST API working fine.
a specific origin, for example: "https://example.com"
a list of origins, for example: ["https://portal.example.com", "https://shop.example.com"]
a wildcard: "*" (Not recommended for production use)
Ideally, this should be set in the site config instead of common site config. And if you’re running a production instance, you will need to run bench restart for the changes to take effect.