Skip to content
DocsTry Aspire
DocsTry

NgrokExtensions Methods

ClassMethods4 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?)extensionIResourceBuilder<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)
{
// ...
}
}
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder to add the resource to.
namestringThe name of the resource.
configurationFolderstring?optionalThe folder where temporary ngrok configuration files will be stored; defaults to .ngrok
endpointPortint?optionalThe port of the endpoint for this resource, defaults to a randomly assigned port.
endpointNamestring?optionalThe name of the endpoint for this resource, defaults to http.
configurationVersionint?optionalThe 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)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<NgrokResource>The ngrok resource builder.
ngrokAuthTokenstringThe ngrok auth token.
IResourceBuilder<NgrokResource>The same reference to ngrok resource builder.
WithAuthToken(IResourceBuilder<NgrokResource>, IResourceBuilder<ParameterResource>)Section titled WithAuthToken(IResourceBuilder<NgrokResource>, IResourceBuilder<ParameterResource>)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<NgrokResource>The ngrok resource builder.
ngrokAuthTokenIResourceBuilder<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>)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<NgrokResource>The ngrok resource builder.
resourceIResourceBuilder<TResource>The resource whose endpoint should be exposed through ngrok.
endpointNamestringThe endpoint name to expose.
ngrokUrlstring?optionalThe ngrok URL to use, or null to allow ngrok to choose one.
labelsIDictionary<string, string>optionalOptional endpoint labels.
IResourceBuilder<NgrokResource>The same reference to ngrok resource builder.
This overload is not available in polyglot app hosts. Use the overload that accepts Generic.IReadOnlyDictionary`2 labels instead.