routes
Each server-side routes
object in an lwr.config.json
file includes some of these properties
Property | Type | Required/Optional | Description |
---|---|---|---|
id | String | Required | The unique identifier for the route. |
path | String | Required | The unique URI path from which the route is served. |
layoutTemplate | String | Optional | The path to a static template that renders the page layout. If you don't set a value for layoutTemplate , it uses a default template. |
contentTemplate | Filepath | See description | Each 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. |
rootComponent | Filepath | See description | Each 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. |
properties | JSON object | Optional | A JSON object that can be passed to the templates as context. |
routeHandler | String | Required | A path to a route handler function configured for the route. |
cache | Key-value pairs | Optional | The cache settings for the routing, including:
|
bootstrap | JSON object | Optional | The bootstrap object contains client options that determine how an application page is loaded, including:
|