After the server-side controller code is defined in Salesforce B2C Commerce Cloud, it is necessary to ensure that it can be consumed by other parts of the application. This is done by exporting the server object. The correct way to make a server-side controller available for page component display is by using the server.exports() method. This approach is validated by typical usage patterns seen in the SFRA where controllers are modular and need to be exported for application-wide accessibility.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit