Going to Production

When it's time to take your Custom Application to production, you need to follow certain steps like building the production bundles.

Building production bundles

The production bundles are created by running the CLI build command:

mc-scripts build

All the necessary static assets are created in the public directory.

By default, the build command compiles the index.html, included in the public folder. You can opt-out of the compilation step by using the option --build-only. See compile-html command for more information.

Assigning the Application ID

Before deploying the Custom Application to production, make sure to provide the Custom Application ID that you got when you configured the Custom Application in the Merchant Center.

The Custom Application ID is provided when you add a Custom Application in the Merchant Center (Organizations > Custom Applications > Configure > Add). See Managing Custom Applications in the Merchant Center for more information.

Assigning the production URL

In the Custom Application config make sure to provide the production URL where the Custom Application will be hosted.

Deploying the production bundles

Deploying and hosting Custom Applications is managed by you. This allows you to choose whatever hosting solution works best for you.

See Deployment Examples to quickly get up and running with some of the common cloud hosting providers.

One important thing to remember when hosting the static assets is that a Custom Application is a Single-Page Application, meaning that all requests must be handled to serve the index.html file.
The client-side routing then does the rest of the work once the Custom Application has been rendered in the browser.

About Static Assets

Depending on where you want to host your Custom Application you might choose to keep the static assets (JS, CSS, etc.) in the same location as the index.html or to have them served by something like a CDN.

If you choose to have them hosted in a separate location, you need to configure the CDN URL in the Custom Application config.