Define Pages
Out of the box, spartacus-mock
comes with the mock-data for the following pages:
Homepage
Search Page
Category Page
Product Detail Page
Cart Page
Checkout Pages
My Account Pages (except Order Return Feature)
Content Page
You can override these pages or provide your own custom pages:
Create a file
src/mock-server/mock-data/pages.ts
Add a
contentPages
function to return the mock-data for your custom pages (Using the ContentPage Class is optional)
Defining a custom page for an existing object-key (aka Page label in the browser) will override the default mock-data for this page.
Append your pages function to the mockConfig in your
main.ts
file
Please note: As your contentPages function grows, make sure, you only call it once and store the result in a variable to avoid performance issues.
Last updated