# withIngressHostAndPath

- Module: [Aspire.Hosting.Kubernetes](/reference/api/typescript/aspire.hosting.kubernetes.md)
- Version: `13.6.4-preview.1.26523.11`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/c89352703f78ae46de90fbf751ed8b52b77b89bf)

Adds a host-scoped path rule to the ingress. The rule matches traffic for the specified host and path, forwarding it to the given endpoint's backing Kubernetes service.

## Definition

```typescript
interface KubernetesIngressResource {
  // ... omitted for brevity
  withIngressHostAndPath(
    host: string,
    path: string,
    endpoint: EndpointReference,
    pathType?: IngressPathType): KubernetesIngressResource
}
```

## Parameters

- `host` (`string`)
- `path` (`string`)
- `endpoint` (`EndpointReference`)
- `pathType` ([IngressPathType](/reference/api/typescript/aspire.hosting.kubernetes/ingresspathtype.md)) `optional` `= Prefix`

## Returns

[KubernetesIngressResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesingressresource.md) `builder`

## Applies to

- [KubernetesIngressResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesingressresource.md)
