Developer Preview Feature
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
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:
|
1{
2 "id": "example",
3 "path": "/",
4 "rootComponent": "example/app",
5 "layoutTemplate": "$layoutsDir/main.html",
6 "properties": { "staticParam": "This is the Home page" },
7 "cache": { "ttl": 60 }
8 "bootstrap": {
9 "syntheticShadow": true,
10 "services": ["example/service", "example/loaderHooks"]
11 }
12}Developer Preview Feature