Reputation: 1
I am trying to setup Spartacus storefront first time. I have done setup commerce cloud 2005 as back-end application. I am able to access the page directly but I am not able to access the home page from Spartacus storefront. I also verified the CORS properties but couldn't find any missing one. Please find the attached screenshot for the error and suggest what is missing.
Error:
Upvotes: 0
Views: 603
Reputation: 996
You are getting a redirect on the preflight request. That probably means that your Commerce instance is not configured to respond on that /rest/v2/basesites URL & is redirecting the response to another page (possibly hac login).
In 1905 and earlier, I would have suggested that this probably meant the cmsoccaddon was not properly installed.
However in 2005, it is more likely a different explanation - the OCC endpoints are on a slightly different address by default in 2005, as it will be setup using the updated version of OCC that comes with 2005. In this case you should be accessing /occ/v2/basesites.
This is mentioned in one of the documentation pages, but is easy to overlook. See https://sap.github.io/spartacus-docs/building-the-spartacus-storefront-from-libraries/#check-appmodulets-for-base-url-and-other-settings in the Spartacus Project Setup section, there is a line relating to this:
prefix: Defines the prefix to OCC calls; change /rest/v2/ to /occ/v2/ if using release 2005
Upvotes: 3