This article describes how to configure NodeJs for DXP Linux containerized environment.
This is applicable to DXP Linux container for CMS 12 and Commerce 14 projects only.
Background
NodeJs is a required component to be installed on web server to use the features of Microsoft.AspNetCore.NodeServices or Microsoft.AspNetCore.SpaServices.Extensions.
Configuration steps
- Create the file dxpPlatformSettings.json at the root folder (same folder as appSettings.json)
Make sure to set "Copy to Output Directory" to "Copy if newer" in Visual Studio. - Add configuration to dxpPlatformSettings.json
Example:
{
"version" value is the major release of NodeJs and must be integer.
"$schema": "https://schema.episerver.net/paasportal/2022-03-24/platformschema.json",
"platformPackages": [
{
"name": "NodeJs",
"version": 14
}
]
} - Build, package output files with dxpPlatformSettings.json and deploy to DXP.
References
- DXP documentation: https://docs.developers.optimizely.com/digital-experience-platform/v1.2.0-dxp-cloud-services/docs/code-package-format#platform-settings-file
- JSON schema for dxpPlatformSettings.json: https://schema.episerver.net/paasportal/2022-03-24/platformschema.json