Skip to content
Docs Try Aspire

NgrokExtensions Methods

Class Methods 4 members
Extension methods for adding ngrok to the application model.
AddNgrok(IDistributedApplicationBuilder, string, string?, int?, string?, int?) Section titled AddNgrok(IDistributedApplicationBuilder, string, string?, int?, string?, int?) extension IResourceBuilder<NgrokResource>
Configures a container resource for grok which is pre-configured to connect to the resource that this method is used on.
public static class NgrokExtensions
{
public static IResourceBuilder<NgrokResource> AddNgrok(
this IDistributedApplicationBuilder builder,
string name,
string? configurationFolder = null,
int? endpointPort = null,
string? endpointName = null,
int? configurationVersion = null)
{
// ...
}
}
builder IDistributedApplicationBuilder The Hosting.IDistributedApplicationBuilder to add the resource to.
name string The name of the resource.
configurationFolder string? optional The folder where temporary ngrok configuration files will be stored; defaults to .ngrok
endpointPort int? optional The port of the endpoint for this resource, defaults to a randomly assigned port.
endpointName string? optional The name of the endpoint for this resource, defaults to http.
configurationVersion int? optional The output version of the ngrok configuration file.
IResourceBuilder<NgrokResource> A reference to the ApplicationModel.IResourceBuilder`1.
WithAuthToken(IResourceBuilder<NgrokResource>, string) Section titled WithAuthToken(IResourceBuilder<NgrokResource>, string) extension IResourceBuilder<NgrokResource>
Adds a ngrok auth token to a ngrok resource.
public static class NgrokExtensions
{
public static IResourceBuilder<NgrokResource> WithAuthToken(
this IResourceBuilder<NgrokResource> builder,
string ngrokAuthToken)
{
// ...
}
}
builder IResourceBuilder<NgrokResource> The ngrok resource builder.
ngrokAuthToken string The ngrok auth token.
IResourceBuilder<NgrokResource> The same reference to ngrok resource builder.
WithAuthToken(IResourceBuilder<NgrokResource>, IResourceBuilder<ParameterResource>) Section titled WithAuthToken(IResourceBuilder<NgrokResource>, IResourceBuilder<ParameterResource>) extension IResourceBuilder<NgrokResource>
Adds a ngrok auth token to a ngrok resource.
public static class NgrokExtensions
{
public static IResourceBuilder<NgrokResource> WithAuthToken(
this IResourceBuilder<NgrokResource> builder,
IResourceBuilder<ParameterResource> ngrokAuthToken)
{
// ...
}
}
builder IResourceBuilder<NgrokResource> The ngrok resource builder.
ngrokAuthToken IResourceBuilder<ParameterResource> The ngrok auth token as a parameter resource.
IResourceBuilder<NgrokResource> The same reference to ngrok resource builder.
WithTunnelEndpoint(IResourceBuilder<NgrokResource>, IResourceBuilder<TResource>, string, string?, IDictionary<string, string>) Section titled WithTunnelEndpoint(IResourceBuilder<NgrokResource>, IResourceBuilder<TResource>, string, string?, IDictionary<string, string>) extension IResourceBuilder<NgrokResource>
Configures a resource with endpoints as a ngrok tunnel endpoint.
public static class NgrokExtensions
{
public static IResourceBuilder<NgrokResource> WithTunnelEndpoint<TResource>(
this IResourceBuilder<NgrokResource> builder,
IResourceBuilder<TResource> resource,
string endpointName,
string? ngrokUrl = null,
IDictionary<string, string>? labels = null)
{
// ...
}
}
builder IResourceBuilder<NgrokResource>
resource IResourceBuilder<TResource>
endpointName string
ngrokUrl string? optional
labels IDictionary<string, string> optional