# WithTunnelEndpoint

- Module: [CommunityToolkit.Aspire.Hosting.Ngrok](/reference/api/go/communitytoolkit.aspire.hosting.ngrok.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: [`NgrokResource`](/reference/api/go/communitytoolkit.aspire.hosting.ngrok/ngrokresource.md)
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Configures a resource with endpoints as a ngrok tunnel endpoint.

## Definition

```go
func (NgrokResource) WithTunnelEndpoint(
    resource ResourceWithEndpoints,
    endpointName string,
    options ...*WithTunnelEndpointOptions,
) NgrokResource
```

## Parameters

- `resource` (`ResourceWithEndpoints`) -- The resource whose endpoint should be exposed through ngrok.
- `endpointName` (`string`) -- The endpoint name to expose.
- `options` (`...*WithTunnelEndpointOptions`) -- optional settings, see [Options](#options)

## Options

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

- `NgrokUrl` (`*string`) -- The ngrok URL to use, or `null` to allow ngrok to choose one.
- `Labels` (`map[string]string`) -- Optional endpoint labels.

## Returns

[`NgrokResource`](/reference/api/go/communitytoolkit.aspire.hosting.ngrok/ngrokresource.md) -- The same reference to ngrok resource builder.

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

## Applies to

- [`NgrokResource`](/reference/api/go/communitytoolkit.aspire.hosting.ngrok/ngrokresource.md)
