Table of Contents

Class HostBuilderExtensions

Namespace
Steeltoe.Common.Hosting
Assembly
Steeltoe.Common.Hosting.dll
public static class HostBuilderExtensions
Inheritance
HostBuilderExtensions
Inherited Members

Fields

DEFAULT_URL

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

Field Value

string

Methods

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