public NancyMiddleware(RequestDelegate next, NancyOptions options) { _next = next; _options = options; _options.Bootstrapper.Initialise(); _engine = _options.Bootstrapper.GetEngine(); }
/// <summary> /// Tells the NancyMiddleware to pass through when /// response has one of the given status codes. /// </summary> /// <param name="nancyOptions">The Nancy options.</param> /// <param name="httpStatusCode">The HTTP status code.</param> public static void PassThroughWhenStatusCodesAre(this NancyOptions nancyOptions, params HttpStatusCode[] httpStatusCode) { nancyOptions.PerformPassThrough = context => httpStatusCode.Any(code => context.Response.StatusCode == code); }