KubernetesGatewayResource.withGatewayHostRoute
Method
interface KubernetesGatewayResource { // ... omitted for brevity withGatewayHostRoute( host: string, path: string, endpoint: EndpointReference, pathType?: GatewayPathMatchType): KubernetesGatewayResource;}Signature
method
withGatewayHostRoute builderAdds a host-and-path-based routing rule to the gateway. The rule matches traffic for the specified host and path, routing it to the given endpoint's backing Kubernetes service. This generates an `HTTPRoute` resource with a `hostnames` filter.
withGatewayHostRoute( host: string, path: string, endpoint: EndpointReference, pathType?: GatewayPathMatchType): KubernetesGatewayResourceParameters
hoststringThe hostname to match (e.g., `"api.example.com"`).pathstringThe URL path to match. 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 Defined on
This method is defined on the following type: