Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 934 Bytes

GiG.Core.Web.Hosting.md

File metadata and controls

36 lines (26 loc) · 934 Bytes

GiG.Core.Web.Hosting

This Library provides an API to configure BASE_PATH and Forwarded Headers.

Path Base

The below code needs to be added to the Startup.cs class. This will configure the Base Path.

public void Configure(IApplicationBuilder app)
{   
    app.UsePathBaseFromConfiguration();
}

By default the Base Path will be retrieved from the configuration key BASE_PATH. The name of the configuration key can be overridden by using the extension method which accepts the config key Name as a parameter.

app.UsePathBaseFromConfiguration("configKeyName");

Forwarded Headers

The below code needs to be added to the Startup.cs class. This will configure the Forwarded Headers.

public void ConfigureServices(IServiceCollection services)
{
    services.ConfigureForwardedHeaders();
}

public void Configure(IApplicationBuilder app)
{
    app.UseForwardedHeaders();
}