I want to do some things in every request, no matter the Module or Route. How can I accomplish this in Nancy 2.x?
If found How to Intercept all Nancy requests and How do I capture all requests irrespective of verb or path, but they are only applicable for Nancy 1.x and the Documentation is out-of-date.
As you say documentation is not updated and most of the resources you can find online are for version 1.x.
How to solve it depends a little bit on what you want to do. If you are not messing with the response you can override
ApplicationStartUpin the bootstrapper like this:If you, on the other hand, need to meddle with the response and the headers you can do it in the constructor of your overridden
NancyModulewith yourGetsetup like this:Both of these solutions work with Nancy 2.0.