This package contains the HTTP server to run a Custom Application in production.
This server should only be used for production, for development we use
@commercetools-frontend/mc-scriptsto start a development server.
$ npm install --save @commercetools-frontend/mc-http-server
We also provide a docker image to run the server:
$ docker run -p 3001:3001 eu.gcr.io/ct-images/mc-http-server:v0.0.0 mc-http-server
Why do we need an HTTP Server?
However, the Custom Application requires certain information and configuration which cannot be provided on build time.
This information is available at runtime through environment variables, which needs to be dynamically injected into the
For that reason, before the server starts, we process the
Additionally, there are some placeholders variables that are replaced with the values from the application config. After that, the final
index.html file is written on disk and ready to be served by the HTTP server.
All static assets are served from the
Besides generating and serving the
index.html, the HTTP server does additionally a couple of things:
- provides a
/versionendpoint with the current revision hash (git SHA)