Skip to content

Instantly share code, notes, and snippets.

View beyond-code-github's full-sized avatar

Pete Smith beyond-code-github

View GitHub Profile
@benfoster
benfoster / gist:9091425
Last active August 29, 2015 13:56
An abuse of OWIN?

I originally thought about writing this as a blog post but it's more of a discussion point than anything else - plus Pete Smith (Roysvork) blogged about it yesterday - http://roysvork.wordpress.com/2014/02/18/are-we-gowing-in-the-right-direction/.

I arrived pretty late to the OWIN party and I'll admit I didn't see the benefit at first. OWIN states its goal as decoupling server and application. So now I can host a website in a windows service - that's pretty cool, although in reality it's unlikely I'll ever need to do this.

However, as I started to learn more about OWIN and see what Microsoft were doing (pushing more of their libraries up to the OWIN level) I could see the opportunities that OWIN opened up. If I write a library that does something in the request pipeline, I could write this as an OWIN Middleware Component (OMC) and now it would work regardless of the web framework you were using (providing it was OWIN compatible) - Web API, Nancy, Simple.Web etc.

A few weeks ago I blogged about a project