# WithHttpHealthCheck

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`ResourceWithEndpoints`](/reference/api/go/aspire.hosting/resourcewithendpoints.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Adds a health check to the resource which is mapped to a specific endpoint.

## Definition

```go
func (ResourceWithEndpoints) WithHttpHealthCheck(options ...*WithHttpHealthCheckOptions) ResourceWithEndpoints
```

## Parameters

- `options` (`...*WithHttpHealthCheckOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithHttpHealthCheckOptions` argument.

- `Path` (`*string`) -- The relative path to test.
- `StatusCode` (`*float64`) -- The result code to interpret as healthy.
- `EndpointName` (`*string`) -- The name of the endpoint to derive the base address from.

## Returns

[`ResourceWithEndpoints`](/reference/api/go/aspire.hosting/resourcewithendpoints.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`CSharpAppResource`](/reference/api/go/aspire.hosting/csharpappresource.md)
- [`ContainerResource`](/reference/api/go/aspire.hosting/containerresource.md)
- [`DotnetToolResource`](/reference/api/go/aspire.hosting/dotnettoolresource.md)
- [`ExecutableResource`](/reference/api/go/aspire.hosting/executableresource.md)
- [`ProjectResource`](/reference/api/go/aspire.hosting/projectresource.md)
