# Router Alias

Type: `middleware.http.routeralias`

Status: alpha

Reference: https://docs.dapr.io/reference/components-reference/supported-middleware/middleware-routeralias/

## Example

```
apiVersion: cra.diagrid.io/v1beta1
kind: Component
metadata:
  name: <name>
spec:
  type: middleware.http.routeralias
  version: v1
  metadata:
    # Dictionary where the key is the path to match in the incoming request, and the value indicates the updated path. This is included as a JSON or YAML-encoded string. (Optional)
    #- name: routes
    #  value: | 
    #    {
    #      "/v1.0/mall/activity/info": "/v1.0/invoke/srv.default/method/mall/activity/info",
    #      "/v1.0/hello/activity/{id}/info": "/v1.0/invoke/srv.default/method/hello/activity/info",
    #      "/v1.0/hello/activity/{id}/user": "/v1.0/invoke/srv.default/method/hello/activity/user"
    #    }
    #    

```

## Metadata

### `routes` (string)

Dictionary where the key is the path to match in the incoming request, and the value indicates the updated path. This is included as a JSON or YAML-encoded string.

Example value:

```
{
  "/v1.0/mall/activity/info": "/v1.0/invoke/srv.default/method/mall/activity/info",
  "/v1.0/hello/activity/{id}/info": "/v1.0/invoke/srv.default/method/hello/activity/info",
  "/v1.0/hello/activity/{id}/user": "/v1.0/invoke/srv.default/method/hello/activity/user"
}

```
