I want to use Nancy with the default routing, as it's clean and works well, however I want an option to log all incoming requests to the console (I'm using Nancy's self-hosting module) irrespective of whether an explicit route exists. Put simply, I want to be able to capture the verb, the incoming request URI, any posted data (if it's a POST request), etc.
How do I do this? Before
/After
only seem to run for requests that match an existing route, and a 404 does not trigger OnError
either. Also, using Get["/(.*)"]
only catches GET requests and will ignore other HTTP verbs.
Use the Before
/After
on an Application level, not Module, for that https://github.com/NancyFx/Nancy/wiki/The-Application-Before%2C-After-and-OnError-pipelines
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With