From 56971836666f369f06ba2651517f61feeca6e77d Mon Sep 17 00:00:00 2001 From: Tom Gardham-Pallister Date: Sat, 25 Feb 2017 19:20:09 +0000 Subject: [PATCH] updated readme --- README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 885c556f..4e765516 100644 --- a/README.md +++ b/README.md @@ -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. ```csharp -IWebHostBuilder builder = new WebHostBuilder(); + public class Program + { + public static void Main(string[] args) + { + IWebHostBuilder builder = new WebHostBuilder(); -builder.ConfigureServices(s => { - s.AddSingleton(builder); -}); + builder.ConfigureServices(s => { + s.AddSingleton(builder); + }); -builder.UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseStartup(); + builder.UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseStartup(); -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