Document Properties
Kbid29V440
Last Modified28-Jul-2020
Added to KB18-Jun-2020
Public AccessEveryone
StatusOnline
Doc TypeGuidelines, Concepts & Cookbooks
ProductIntershop Progressive Web App

Guide - Intershop Progressive Web App - Building and Running Server-Side Rendering

Building and Running Server-Side Rendering

Building

To simply build the Intershop PWA in server-side rendering mode, you can use the package.json script npm run build, which will build the Intershop PWA with the production configuration of the angular.json.
Afterwards you can start the application with npm run serve (or do both by using npm run start).

The preferred way for production deployments is to build the Dockerfile in the project root and run the created image.
While building you can provide a build argument (i.e. via --build-arg) configuration and build a different configuration from angular.json.
By default the production configuration is built.

Running

Overwriting configurations of the PWA is entirely done by environment variables.
This approach was chosen to have the best possible compatibility when running the PWA either from the command line or in an orchestrator.

To set environment variables in windows just run for example set SSR_HYBRID=true on the command line before executing the npm run commands.

If the format is any, then the environment variable just has to be set to any value to be active.
Setting it to "false" still counts as active.
Only empty strings count as inactive.

parameter format comment
SSR Specific PORT number port for running the application
SSL any enable TLS (expects server.crt and server.key in dist folder)
General ICM_BASE_URL string sets the base URL for the ICM
ICM_CHANNEL string overrides the default channel
ICM_APPLICATION string overrides the default application
FEATURES comma-separated list overrides active features
THEME string overrides the default theme
Debug ⚠️ TRUST_ICM any use this if ICM is deployed with an insecure certificate
LOGGING any enable extra log output
Hybrid Approach SSR_HYBRID any enable running PWA and ICM in Hybrid Mode
PROXY_ICM any proxy ICM via /INTERSHOP (enabled if SSR_HYBRID is active)
Third party GTM_TOKEN string token for Google Tag Manager
SENTRY_DSN string Sentry DSN URL for using Sentry Error Monitor

References

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Intershop Support
Knowledge Base
Product Resources
Support Tickets