---
schema_version: "1"
id: 3c7758a03a3a97525c7779f4ae0fc1ed439ff769baeaed676a3901919a6e3c91
title: routes
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwr-node/lwr/references/ss-routing-reference/route.md
canonical_url: https://developer.salesforce.com/docs/platform/lwr/references/ss-routing-reference/route.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 405c45b1243ace3ea818fe616c25010b3513142f06b0b84b27e6cb98f3857f37
products:
  - Lightning Web Runtime
---
# routes

Each server-side `routes` object in an `lwr.config.json` file includes some of these properties

## 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](https://developer.salesforce.com/docs/platform/lwr/guide/lwr-templates.html). 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   | E**ach 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](https://developer.salesforce.com/docs/platform/lwr/guide/lwr-routing-server.html#route-handler-functions) configured for the route.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `cache`           | Key-value pairs | Optional          | The cache settings for the routing, including: <ul><li>`ttl`: A number, in seconds, or a [time string](https://github.com/vercel/ms#examples) to use as the max-age on the [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control) header.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `bootstrap`       | JSON object     | Optional          | The `bootstrap` object contains client options that determine how an application page is loaded, including: <ul><li>`syntheticShadow`: An optional boolean value. When `true`, [LWC synthetic shadow](https://www.npmjs.com/package/@lwc/synthetic-shadow) is enabled. The default value is `false`.</li><li>`services`: An optional array of LWC modules to run on page load.</li><li>`ssr`: An optional boolean value. When `true`, [server-side rendering](https://developer.salesforce.com/docs/platform/lwr/guide/lwr-what-is-ssr.html) is enabled for the route. The default value is `false`.</li><li>`mixedMode`: An optional boolean value. When `true`, [mixed mode](https://developer.salesforce.com/docs/platform/lwc/guide/create-mixed-shadow.html) is enabled for the route. The default value is `false`.</li></ul> |

## Example

```
{
  "id": "example",
  "path": "/",
  "rootComponent": "example/app",
  "layoutTemplate": "$layoutsDir/main.html",
  "properties": { "staticParam": "This is the Home page" },
  "cache": { "ttl": 60 }
  "bootstrap": {
      "syntheticShadow": true,
      "services": ["example/service", "example/loaderHooks"]
  }
}
```
