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

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -