public static void UseDebug(this IAppBuilder app, DebugOptions options = null) { if (options == null) { options = new DebugOptions(); } app.Use <Debug>(options); }
public Debug(AppFunc next, DebugOptions options) { _next = next; _options = options; if (_options.OnIncomingRequest == null) { _options.OnIncomingRequest = (ctx) => { Console.WriteLine("Incoming Request: " + ctx.Request.Path); } } ; if (_options.OnOutgoingRequest == null) { _options.OnOutgoingRequest = (ctx) => { Console.WriteLine("Outgoing Request: " + ctx.Request.Path); } } ; }