# withIngressPath

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

Adds a path-based rule to the ingress. The rule matches all hosts and forwards traffic matching the specified path to the given endpoint's backing Kubernetes service.

## Definition

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

## Parameters

- `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)
