BETA

HTTP Server

We recommend using our @commercetools-frontend/mc-http-server package to run the application in production mode.

The @commercetools-frontend/mc-http-server has built-in functionality that is necessary for the application to work. Most importantly:

  • Compiling the index.html.template into index.html to inject the runtime configuration in the env.json file.
  • Preparing the HTTP response headers, including the custom headers.json configuration (Content Security Policy).

The package comes with a binary mc-http-server that sets up all the necessary configurations and starts a small Node.js server.

mc-http-server --config $(pwd)/env.json --headers $(pwd)/headers.json

Docker image

A pre-built Docker image (eu.gcr.io/ct-images/mc-http-server) is also available for running the application in a Docker environment:

docker pull eu.gcr.io/ct-images/mc-http-server
docker run \
-v $(pwd):/etc/app \
-p 8080:8080 \
eu.gcr.io/ct-images/mc-http-server \
--config /etc/app/env.json \
--headers /etc/app/headers.json

The version of the Docker image is the same as the last release of the merchant-center-application-kit.

Developer Center
HTTP APIGraphQL APIBETAPlatform Release NotesCustom ApplicationsBETASDKs & Client LibrariesImport & Export ToolsSUNRISE Starter FrontendsTutorialsFAQ
Merchant Center
DocumentationRelease Notes
Copyright © 2020 commercetools