diff --git a/readme.md b/readme.md index e3b6e8f..a7bf3af 100644 --- a/readme.md +++ b/readme.md @@ -10,6 +10,14 @@ PS> Install-Package Owin.ForceHttps # Usage +1. ### Make sure your project has SSL enabled + + * Find your web project and hit `F4` to get the Properties window + * Toggle `SSL Enabled` to `True` and note the port number for the `SSL URL` + ![VS project Properties window snip](http://i.imgur.com/kn8ENIa.png) + +2. ### Add `app.UseForcedHttps()` to `Startup.cs` class: + ```csharp using Owin; using Microsoft.Owin; @@ -17,7 +25,11 @@ using Microsoft.Owin; namespace MyApplication { public class Startup { public void Configuration(IAppBuilder app) { +#if DEBUG + app.UseForcedHttps(44309); // IIS Express +#else app.UseForcedHttps(443); +#endif //configure other middleware } @@ -25,8 +37,6 @@ namespace MyApplication { } ``` -There is also an overload which allows you to specify a different port for HTTPS. Useful for local development. - # License MIT