Skip to content
This repository has been archived by the owner on Dec 20, 2017. It is now read-only.

added comprehensive usage for folks who don't even have SSL enabled #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,33 @@ 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;

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
}
}
}
```

There is also an overload which allows you to specify a different port for HTTPS. Useful for local development.

# License

MIT