2013-09-18 23:55:13 -07:00
|
|
|
using Nancy.Bootstrapper;
|
2013-05-04 14:09:25 -07:00
|
|
|
using Nancy.Owin;
|
|
|
|
using Owin;
|
|
|
|
|
2013-08-06 22:32:22 -07:00
|
|
|
namespace NzbDrone.Host.Owin.MiddleWare
|
2013-05-04 14:09:25 -07:00
|
|
|
{
|
|
|
|
public class NancyMiddleWare : IOwinMiddleWare
|
|
|
|
{
|
|
|
|
private readonly INancyBootstrapper _nancyBootstrapper;
|
|
|
|
|
|
|
|
public NancyMiddleWare(INancyBootstrapper nancyBootstrapper)
|
|
|
|
{
|
|
|
|
_nancyBootstrapper = nancyBootstrapper;
|
|
|
|
}
|
|
|
|
|
2013-05-05 14:24:33 -07:00
|
|
|
public int Order { get { return 1; } }
|
|
|
|
|
2013-05-04 14:09:25 -07:00
|
|
|
public void Attach(IAppBuilder appBuilder)
|
|
|
|
{
|
2013-09-18 23:55:13 -07:00
|
|
|
var options = new NancyOptions
|
|
|
|
{
|
|
|
|
Bootstrapper = _nancyBootstrapper,
|
|
|
|
PerformPassThrough = context => context.Request.Path.StartsWith("/signalr")
|
|
|
|
};
|
|
|
|
|
|
|
|
appBuilder.UseNancy(options);
|
2013-05-04 14:09:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|