Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 1.52 KB

GiG.Core.Hosting.md

File metadata and controls

64 lines (46 loc) · 1.52 KB

GiG.Core.Hosting

This Library provides an API to register hosting related functionailty to an application.

Application Metadata

Basic Usage

The below code needs to be added to the Program.cs. This will register the application metadata accessor.

static class Program
{
    public static void Main()
    {
        CreateHostBuilder().Build().Run();
    }

    private static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .UseApplicationMetadata();
}

Configuration

The ApplicationName should be configured from the appsettings.json. By default it will use the Assembly's Entrypoint name

Info Management Endpoint

Basic Usage

The below code needs to be added to the Startup.cs to register an information endpoint.

public void ConfigureServices(IServiceCollection services)
{
	services.ConfigureInfoManagement(_configuration);
}

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

Configuration

The below table outlines the valid Configurations.

Configuration Name Type Optional Default Value
Url String No /actuator/info
Checksum InfoManagementChecksumOptions Yes

Sample Configuration

{
  "InfoManagement": {
    "Url": "/info"       
  }
}