routes

Each server-side routes object in an lwr.config.json file includes some of these properties

PropertyTypeRequired/OptionalDescription
idStringRequiredThe unique identifier for the route.
pathStringRequiredThe unique URI path from which the route is served.
layoutTemplateStringOptionalThe path to a static template that renders the page layout. If you don't set a value for layoutTemplate, it uses a default template.
contentTemplateFilepathSee descriptionEach route must have either a rootComponent or a contentTemplate, but not both. Set contentTemplate as the path to a static template that renders the page content.
rootComponentFilepathSee descriptionEach route must have either a rootComponent or a contentTemplate, but not both. Set rootComponent as the path to the top-level Lightning web component that LWR bootstraps into the HTML output for the route. If you use a rootComponent, LWR applies a default contentTemplate to render it.
propertiesJSON objectOptionalA JSON object that can be passed to the templates as context.
routeHandlerStringRequiredA path to a route handler function configured for the route.
cacheKey-value pairsOptionalThe cache settings for the routing, including:
bootstrapJSON objectOptionalThe bootstrap object contains client options that determine how an application page is loaded, including:
  • syntheticShadow: An optional boolean value. When true, LWC synthetic shadow is enabled. The default value is false.
  • services: An optional array of LWC modules to run on page load.
  • ssr: An optional boolean value. When true, server-side rendering is enabled for the route. The default value is false.
  • mixedMode: An optional boolean value. When true, mixed mode is enabled for the route. The default value is false.