The commerce mock emulates SAP Commerce Cloud. It uses the varkes-api-server to connect to SAP Business Technology Platform, Kyma Runtime
and register the bundled commerce APIs, which are also mocked using the varkes-openapi-mock. For the list of mocked APIs, see varkes_config.json
.
To run the mock locally, run:
docker run -d \
-p 10000:10000 \
--restart=always \
--name commerce-mock \
ghcr.io/sap-samples/xf-application-mocks/commerce-mock:latest
- For mock UI, see
http://localhost:10000
- For the API to pair the mock, see
http://localhost:10000/console
- For mocked APIs, see:
http://localhost:10000/rest/v2/console
http://localhost:10000/assistedservicewebservices/console
http://localhost:10000/ordermanagementwebservices/console
http://localhost:10000/couponwebservices/console
http://localhost:10000/warehousingwebservices/console
To run the mock using SAP Business Technology Platform, Kyma Runtime
as a runtime environment, perform the following steps:
- Set up the Namespace:
kubectl create namespace mocks
- Deploy the mock:
kubectl apply -f https://raw.githubusercontent.com/SAP/xf-application-mocks/main/commerce-mock/deployment/k8s.yaml -n mocks
kubectl apply -f https://raw.githubusercontent.com/SAP/xf-application-mocks/main/commerce-mock/deployment/kyma.yaml -n mocks
These commands expose the UI and API of the mock via an APIRule
resource and makes the UI accessible at https://commerce.{yourDomain}
.
- Set up the Namespace:
kubectl create namespace mocks
- Deploy the mock:
kubectl apply -f https://raw.githubusercontent.com/SAP/xf-application-mocks/main/commerce-mock/deployment/k8s.yaml -n mocks
This command deploys a Service
of a ClusterIP type. You need to expose it manually using any Ingress type.
Use npm
to build and run the mock locally for development:
npm install
npm start
This starts the mock locally on port 10000.
To enable the debug mode, set the {DEBUG} environment variable to true
.
To run the test, execute:
npm test