React to hosting

This commit is contained in:
Hao Kung 2015-03-30 18:19:35 -07:00
parent 19696895a2
commit f3de094815
1 changed files with 6 additions and 7 deletions

View File

@ -8,6 +8,7 @@ using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Hosting.Startup;
using Microsoft.AspNet.Http;
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.Runtime.Infrastructure;
namespace Microsoft.AspNet.WebSockets.Client.Test
{
@ -45,13 +46,11 @@ namespace Microsoft.AspNet.WebSockets.Client.Test
config.Add(new MemoryConfigurationSource());
config.Set("server.urls", "http://localhost:54321");
var context = new HostingContext()
{
Configuration = config,
ServerFactoryLocation = "Kestrel",
StartupMethods = new StartupMethods(startup, configureServices: null)
};
return new HostingEngine().Start(context);
var engine = WebHost.CreateEngine(config)
.UseServer("Kestrel")
.UseStartup(startup);
return engine.Start();
}
}
}