updated readme

This commit is contained in:
Tom Gardham-Pallister 2017-02-25 19:20:09 +00:00
parent 4c6c3d3caa
commit 5697183666

View File

@ -119,19 +119,25 @@ Then in your Program.cs you will want to have the following. This can be changed
don't wan't to use the default url e.g. UseUrls(someUrls) and should work as long as you keep the WebHostBuilder registration. don't wan't to use the default url e.g. UseUrls(someUrls) and should work as long as you keep the WebHostBuilder registration.
```csharp ```csharp
IWebHostBuilder builder = new WebHostBuilder(); public class Program
{
public static void Main(string[] args)
{
IWebHostBuilder builder = new WebHostBuilder();
builder.ConfigureServices(s => { builder.ConfigureServices(s => {
s.AddSingleton(builder); s.AddSingleton(builder);
}); });
builder.UseKestrel() builder.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>(); .UseStartup<Startup>();
var host = builder.Build(); var host = builder.Build();
host.Run(); host.Run();
}
}
``` ```
Sadly we need to inject the IWebHostBuilder interface to get the applications scheme, url and port later. I cannot Sadly we need to inject the IWebHostBuilder interface to get the applications scheme, url and port later. I cannot