withGatewayPathRoute

Method
📦 Aspire.Hosting.Kubernetes v17.0.0
interface KubernetesGatewayResource {
// ... omitted for brevity
withGatewayPathRoute(
path: string,
endpoint: EndpointReference,
pathType?: GatewayPathMatchType): KubernetesGatewayResource;
}

Signature

methodwithGatewayPathRoutebuilder
Adds a path-based routing rule to the gateway. The rule matches each hostname configured with `WithHostname`, or all hosts when no hostname is configured, and routes matching traffic to the endpoint's backing Kubernetes service. This generates an `HTTPRoute` resource attached to the Gateway.
withGatewayPathRoute(
path: string,
endpoint: EndpointReference,
pathType?: GatewayPathMatchType): KubernetesGatewayResource
pathstringThe URL path to match (e.g., `"/"` or `"/api"`). Must start with `/`.
endpointEndpointReferenceThe endpoint reference identifying the target service and port.
pathTypeGatewayPathMatchTypeoptional= PathPrefixThe path matching strategy. Defaults to `PathPrefix`.
KubernetesGatewayResource

Applies to

This method applies to the following types: