Sponsor: Using RabbitMQ or Azure Service Bus in your .NET systems? Well, you could just use their SDKs and roll your own serialization, routing, outbox, retries, and telemetry. I mean, seriously, how hard could it be?

OWIN
OWIN defines a standard interface between .NET web servers and web applications. The goal of the OWIN interface is to decouple server and application, encourage the development of simple modules for .NET web development, and, by being an open standard, stimulate the open source ecosystem of .NET web development tools.To clarify and reword slightly, OWIN is a open source specification that is not defined by microsoft and is not an actual implementation.
Katana
Katana is an open source project by the Microsoft Open Technologies. It’s a set of components for building and hosting OWIN-based web applications that follows the OWIN specification. I’m not entirely sure what the status is of OWIN/Katana within ASP.NET 5 (vNext), however I would like to think the separation between server, host, middleware, and application will continue.Video Tutorial
If you prefer to follow along with a video tutorial, take a look at the video below.Demo
All of the source code for this demo is available on Github.The first thing we are going to do for this demo is create a Console Application and add the Owin SelfHost and WebAPI Owin Selfhost nuget packages
PM> Install-Package Microsoft.Owin.SelfHost PM> Install-Package Microsoft.AspNet.WebApi.OwinSelfHostNext, we will create a Startup class that will contain the HttpConfiguration similar to how you configure Web Api currently. The startup class is the implementation of the OWIN specification that our OWIN Self Host implementation will use. The Startup class must provide a public Configuration() method with the signature void. Next, we will create a simple ApiController. Last step is to add the web server implementation to out Program.cs Main() method. This is done by simply calling out Katana implementation of WebApp.Start and passing our Startup class name as a type argument along with the host/port binding details as the first parameter argument. That’s it! Now when I make a call from Postman to http://localhost:8080/api/demo, here are the results:

Source Code
