예제 #1
0
    public static void UseDebugMiddleware(this IAppBuilder app, DebugMiddlewareOptions options = null)
    {
        if (options == null)
        {
            options = new DebugMiddlewareOptions();
        }

        app.Use <DebugMiddleware>(options);
    }
        public static void UseDebugMiddleware(this IAppBuilder app, DebugMiddlewareOptions options = null)
        {
            if (options == null)
            {
                options = new DebugMiddlewareOptions();
            }

            app.Use<DebugMiddleware>(options);
        }
예제 #3
0
    public DebugMiddleware(AppFunc next, DebugMiddlewareOptions options)
    {
        _next    = next;
        _options = options;

        if (options.OnIncomingRequest == null)
        {
            _options.OnIncomingRequest = (ctx) => { Debug.WriteLine("Incoming request: " + ctx.Request.Path); };
        }

        if (options.OnOutgoingRequest == null)
        {
            _options.OnOutgoingRequest = (ctx) => { Debug.WriteLine("Outgpoing response: " + ctx.Request.Path); };
        }
    }
예제 #4
0
 public static void UseDebugMiddleware(this IAppBuilder app, DebugMiddlewareOptions options)
 {
     app.Use<DebugMiddleware>(options);
 }