public static void UseDebugMiddleware(this IAppBuilder app, DebugMiddlewareOptions options = null)
        {
            if (options == null)
            {
                options = new DebugMiddlewareOptions();
            }

            app.Use <DebugMiddleware>(options);
        }
Exemplo n.º 2
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("Outgoing request: " + ctx.Request.Path); };
        }
        public DebugMiddleware(AppFunc next, DebugMiddlewareOptions options)
        {
            this.next    = next;
            this.options = options;

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

            if (this.options.OnOutgoingRequest == null)
            {
                this.options.OnOutgoingRequest = (ctx) => { Debug.WriteLine("Outgoing request: " + ctx.Request.Path); }
            }
            ;
        }