withGatewayPathRoute
Method
interface KubernetesGatewayResource { // ... omitted for brevity withGatewayPathRoute( path: string, endpoint: EndpointReference, pathType?: GatewayPathMatchType): KubernetesGatewayResource;}Signature
method
withGatewayPathRoute builderAdds 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): KubernetesGatewayResourceParameters
pathstringThe URL path to match (e.g., `"/"` or `"/api"`). Must start with `/`.endpointEndpointReference The endpoint reference identifying the target service and port.pathType GatewayPathMatchType optional= PathPrefixThe path matching strategy. Defaults to `PathPrefix`.Returns
KubernetesGatewayResource Applies to
This method applies to the following types: