React to configuration API changes.
This commit is contained in:
parent
985a261ae8
commit
3e733348ea
|
|
@ -3,9 +3,6 @@
|
||||||
|
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNet.Builder;
|
||||||
using Microsoft.AspNet.Http;
|
using Microsoft.AspNet.Http;
|
||||||
using Microsoft.Dnx.Runtime;
|
|
||||||
using Microsoft.Framework.Configuration;
|
|
||||||
using Microsoft.Framework.DependencyInjection;
|
|
||||||
using Microsoft.Framework.Logging;
|
using Microsoft.Framework.Logging;
|
||||||
|
|
||||||
namespace ServerComparison.TestSites
|
namespace ServerComparison.TestSites
|
||||||
|
|
@ -25,23 +22,6 @@ namespace ServerComparison.TestSites
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StartupHelloWorld
|
public class StartupHelloWorld
|
||||||
{
|
{
|
||||||
public StartupHelloWorld(IApplicationEnvironment env)
|
|
||||||
{
|
|
||||||
//Below code demonstrates usage of multiple configuration sources. For instance a setting say 'setting1' is found in both the registered sources,
|
|
||||||
//then the later source will win. By this way a Local config can be overridden by a different setting while deployed remotely.
|
|
||||||
var builder = new ConfigurationBuilder(env.ApplicationBasePath)
|
|
||||||
.AddJsonFile("config.json")
|
|
||||||
.AddEnvironmentVariables(); //All environment variables in the process's context flow in as configuration values.
|
|
||||||
Configuration = builder.Build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IConfiguration Configuration { get; private set; }
|
|
||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
|
||||||
{
|
|
||||||
// services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
||||||
{
|
{
|
||||||
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
|
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,6 @@
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNet.Builder;
|
||||||
using Microsoft.AspNet.Http;
|
using Microsoft.AspNet.Http;
|
||||||
using Microsoft.AspNet.Http.Features;
|
using Microsoft.AspNet.Http.Features;
|
||||||
using Microsoft.AspNet.Server.WebListener;
|
|
||||||
using Microsoft.Dnx.Runtime;
|
|
||||||
using Microsoft.Framework.Configuration;
|
|
||||||
using Microsoft.Framework.DependencyInjection;
|
|
||||||
using Microsoft.Framework.Logging;
|
using Microsoft.Framework.Logging;
|
||||||
using Microsoft.Net.Http.Server;
|
using Microsoft.Net.Http.Server;
|
||||||
|
|
||||||
|
|
@ -28,22 +24,6 @@ namespace ServerComparison.TestSites
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StartupNtlmAuthentication
|
public class StartupNtlmAuthentication
|
||||||
{
|
{
|
||||||
public StartupNtlmAuthentication(IApplicationEnvironment env)
|
|
||||||
{
|
|
||||||
//Below code demonstrates usage of multiple configuration sources. For instance a setting say 'setting1' is found in both the registered sources,
|
|
||||||
//then the later source will win. By this way a Local config can be overridden by a different setting while deployed remotely.
|
|
||||||
var builder = new ConfigurationBuilder(env.ApplicationBasePath)
|
|
||||||
.AddJsonFile("config.json")
|
|
||||||
.AddEnvironmentVariables(); //All environment variables in the process's context flow in as configuration values.
|
|
||||||
Configuration = builder.Build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IConfiguration Configuration { get; private set; }
|
|
||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
||||||
{
|
{
|
||||||
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
|
loggerFactory.AddConsole(minLevel: LogLevel.Warning);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue