This is an experimental configuration of Spartacus and xdn-router. More about the two here:
- Spartacus https://github.com/SAP/cloud-commerce-spartacus-storefront
- XDN https://www.moovweb.com/faq
- Build Spartacus SSR
$ yarn build:ssr
- Start the server
$ yarn serve:ssr
- Start the xdn router server
$ node server.js
- Test - open http://localhost:3000
XDN is a CDN as code provided by MOOVWEB. It let's you control caching mechanism programmatically.
To use it we set up an Express server that renders Spartacus app (listening on localhost:3002). Then we set up the xdn-router in front of it (listening on localhost:3000), so that it calls Spartacus and is able to cache it.
We can configure the caching mechanism in router.js
.
This is a PoC (Proof of Concept) that it is possible to deploy Spartacus or plain Angular apps to MOOVWEB XDN. However, it requires some extra development to be production ready.
Thanks to Mark Brocato for helping out with this setup.