public static IApplicationBuilder UseNancy( this IApplicationBuilder builder, Action <NancyOptions> configure = null) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } var opts = new NancyOptions(); configure?.Invoke(opts); return(builder.UseMiddleware <NancyMiddleware>(opts)); }
public NancyMiddleware( NancyOptions options, ILogger <NancyMiddleware> logger, RequestDelegate next) { _options = options; var bootstrapper = _options.Bootstrapper ?? new DefaultNancyBootstrapper(); //new DefaultKestrelBootstrapper(); bootstrapper.Initialise(); _engine = bootstrapper.GetEngine(); _logger = logger; _next = next; }