Table of Contents

Class HostBuilderExtensions

Namespace
Steeltoe.Common.Hosting
Assembly
Steeltoe.Common.Hosting.dll
[Obsolete("This feature will be removed in the next major version. See https://steeltoe.io/docs/v3/obsolete for details.")]
public static class HostBuilderExtensions
Inheritance
HostBuilderExtensions
Inherited Members

Fields

DEFAULT_URL

public const string DEFAULT_URL = "http://*:8080"

Field Value

string

Methods

UseCloudHosting(WebApplicationBuilder, int?, int?)

Configure the application to listen on port(s) provided by the environment at runtime. Defaults to port 8080.

public static WebApplicationBuilder UseCloudHosting(this WebApplicationBuilder webApplicationBuilder, int? runLocalHttpPort = null, int? runLocalHttpsPort = null)

Parameters

webApplicationBuilder WebApplicationBuilder

Your WebApplicationBuilder

runLocalHttpPort int?

Set the Http port number with code so you don't need to set environment variables locally

runLocalHttpsPort int?

Set the Https port number with code so you don't need to set environment variables locally

Returns

WebApplicationBuilder

Your WebApplicationBuilder, now listening on port(s) found in the environment or passed in

Remarks

runLocalPort parameter will not be used if an environment variable PORT is found

THIS EXTENSION IS NOT COMPATIBLE WITH IIS EXPRESS

UseCloudHosting(IWebHostBuilder, int?, int?)

Configure the application to listen on port(s) provided by the environment at runtime. Defaults to port 8080.

public static IWebHostBuilder UseCloudHosting(this IWebHostBuilder webHostBuilder, int? runLocalHttpPort = null, int? runLocalHttpsPort = null)

Parameters

webHostBuilder IWebHostBuilder

Your IWebHostBuilder

runLocalHttpPort int?

Set the Http port number with code so you don't need to set environment variables locally

runLocalHttpsPort int?

Set the Https port number with code so you don't need to set environment variables locally

Returns

IWebHostBuilder

Your IWebHostBuilder, now listening on port(s) found in the environment or passed in

Remarks

runLocalPort parameter will not be used if an environment variable PORT is found

UseCloudHosting(IHostBuilder, int?, int?)

Configure the application to listen on port(s) provided by the environment at runtime. Defaults to port 8080.

public static IHostBuilder UseCloudHosting(this IHostBuilder hostBuilder, int? runLocalHttpPort = null, int? runLocalHttpsPort = null)

Parameters

hostBuilder IHostBuilder

Your IHostBuilder

runLocalHttpPort int?

Set the Http port number with code so you don't need to set environment variables locally

runLocalHttpsPort int?

Set the Https port number with code so you don't need to set environment variables locally

Returns

IHostBuilder

Your IHostBuilder, now listening on port(s) found in the environment or passed in

Remarks

runLocalPort parameter will not be used if an environment variable PORT is found

THIS EXTENSION IS NOT COMPATIBLE WITH IIS EXPRESS