mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 10:17:47 +00:00
27 lines
No EOL
846 B
C#
27 lines
No EOL
846 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Nancy.Bootstrapper;
|
|
using Nancy.Owin;
|
|
using Owin;
|
|
|
|
namespace NzbDrone.Owin.MiddleWare
|
|
{
|
|
public class NancyMiddleWare : IOwinMiddleWare
|
|
{
|
|
private readonly INancyBootstrapper _nancyBootstrapper;
|
|
|
|
public NancyMiddleWare(INancyBootstrapper nancyBootstrapper)
|
|
{
|
|
_nancyBootstrapper = nancyBootstrapper;
|
|
}
|
|
|
|
public int Order { get { return 1; } }
|
|
|
|
public void Attach(IAppBuilder appBuilder)
|
|
{
|
|
var nancyOwinHost = new NancyOwinHost(null, _nancyBootstrapper);
|
|
appBuilder.Use((Func<Func<IDictionary<string, object>, Task>, Func<IDictionary<string, object>, Task>>)(next => (Func<IDictionary<string, object>, Task>)nancyOwinHost.Invoke), new object[0]);
|
|
}
|
|
}
|
|
} |