Hey All,
I have a pretty simple Express app running at https://hammerhead-app-ruqkl.ondigitalocean.app/. I have used the DigitalOcean settings for the app to configure a CORS policy as follows:
.* using Regex
ACCESS-CONTROL-ALLOW-METHODS GET, POST, CONNECT
ACCESS-CONTROL-ALLOW-HEADERS None
ACCESS-CONTROL-EXPOSE-HEADERS None
ACCESS-CONTROL-MAX-AGE None
ACCESS-CONTROL-ALLOW-CREDENTIALS Disabled
I am getting CORS errors when a page at say https://mydomain.com tries to make an Ajax request(GET) to https://hammerhead-app-ruqkl.ondigitalocean.app/. Looking in the developer console I do not see any access-control-allow-origin
header being sent.
Any help and guidance will be appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
I believe that in order to use a custom domain name, you need to first follow the steps here on how to add your domain to your app:
https://docs.digitalocean.com/products/app-platform/how-to/manage-domains/
Then after that you could follow the steps here on how to configure your CORS:
https://docs.digitalocean.com/products/app-platform/how-to/configure-cors-policies/
Also, make sure to add
content-type header
inAccess-Control-Allow-Headers
.Best,
Bobby