Hi I am using Angular Universal and my angular version is 15. I just setup a Ghost Pro (v5.0) account with the sole purpose of using the content API for my blog (not launched in production yet). The goal is to make http request from angular universal to ghost api to get the content and show them on my website.
My goal is to optimize my website for SEO by writing blogs using ghost pro CMS.
The problem is with CORS i.e whenever I make a request to the api
I get a CORS issue because the domain Iâm making request from (in this case http://localhost:4200) is not whitelisted on ghost server. SO the question is how can I whitelist domains to make an http request to ghost server ?
Is there some kind of admin dashboard ? Or code examples ?
To Recreate the problem:
You can simply setup a ghost account locally (with no changes). Setup an angular application and make and http request to the ghost server to load content.
After digging into the error I got in the chrome browser console. I found the following part of the message to be the key to understanding the problem.
The value of the âAccess-Control-Allow-Originâ header in the response must not be the wildcard 'â when the requestâs credentials mode is âincludeâ.*
The request credentials mode was âincludeâ because Iâve set the âwithCredentialsâ to true in my header parameters as shown here.