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

            app.Use <DebugMiddleware>(options);
        }
Esempio n. 2
0
        public DebugMiddleware(AppFunc next, DebugMiddlewareOptions options)
        {
            _next    = next;
            _options = options;

            if (_options.OnIncommingRequest == null)
            {
                _options.OnIncommingRequest = (ctx) => {
                    Debug.WriteLine($"Incomming request: {ctx.Request.Path}");
                }
            }
            ;

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