How to Intercept all Nancy requests -


i have seen post: nancy: how capture requests irrespective of verb or path , followed along on github article.

but not work. have added class in project:

 public class mybootstrapper : nancy.defaultnancybootstrapper 

but class never instantiated, , github documentation not discuss in detail.

what need cause bootstrapper used?

i found it. there 2 ways add items pipeline. 1 deriving bootstrap class, failed me. other implementing class honored iapplicationstartup interface. worked, , here code:

  public class beforeallrequests : iapplicationstartup {     public void initialize(ipipelines pipelines)     {         pipelines.beforerequest.additemtostartofpipeline(ctx => {             if (ctx != null)             {                 log.debug("request: " + ctx.request.url);             }             return null;         });     } } 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -