Skip to main content

Advanced Configurations in routes.json

This document covers advanced configurations and usage patterns for routes.json.

Custom Wrappers​

You can specify custom wrappers for your routes to add additional functionality or behavior.

{
"/custom-route": {
"wrapperPath": "@your-package/custom-wrapper"
}
}

Resource URIs​

For routes that are associated with specific resources, you can specify a resourceUri:

{
"/api/resource/:id": {
"resourceUri": "/api/resource/{id}"
}
}

Dynamic Routes​

For dynamic routes, use parameters in your path definition:

{
"/user/:userId": {
"componentPath": "@your-package/UserProfile"
}
}

Nested Routes​

You can define nested routes to create a hierarchical structure:

{
"/parent": {
"componentPath": "@your-package/ParentComponent",
"children": {
"/child": {
"componentPath": "@your-package/ChildComponent"
}
}
}
}

Route-Specific Configurations​

You can add custom configurations for specific routes:

{
"/custom-config": {
"customConfig": {
"key1": "value1",
"key2": "value2"
}
}
}

These advanced configurations allow for more flexible and powerful routing setups in your application.

Back to Index | Previous: Middleware System | Next: Generated Data Loaders