# NgrokResource.WithTunnelEndpoint

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

Configures a resource with endpoints as a ngrok tunnel endpoint.

## Definition

```go
type NgrokResource interface {
    // ... omitted for brevity
    WithTunnelEndpoint(
        resource ResourceWithEndpoints,
        endpointName string,
        options ...*WithTunnelEndpointOptions,
    ) NgrokResource
}
```

## Signature

```go
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()`.

## Defined on

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