These are the code samples I've demonstrated on the DevFM #10 : OWIN & Katana event at the Microsoft Innovation Center in Mons, Belgium.
This repository contains 5 samples with different iterations.
- HelloWorld
- Raw: an inline delegate that returns the well-known Hello, world! message;
- HTML: the same sample but now returning a whole HTML document;
- Strongly typed: the same sample but using the OwinContext instead of a weakly typed dictionary;
- Chaining
- Short-circuit: an example of how to not chain middlewares;
- The right way: an example of how to chain middlewares;
- Both ways: an example of how the request and response navigates in the OWIN pipeline;
- Conditionals
- Nested app: a nested app that responds to a specific path;
- More nested app: a nested app with two level of depth;
- When condition: a nested app that responds to a specific path and when a condition is met;
- Middlewares
- Custom classes: an example of how to create custom middleware classes;
- Reading request: demoing how to read the request body stream multipe times;
- WebAPI: an example of how to integrate ASP.NET Web API into an OWIN pipeline;
- CompleteSample
- CompleteSample: a complete sample of a pipleine with 3 actual middlewares (logging, authentication and Web API)