Just a few quick remarks. If an (routed) path exists the nancy application, the default http status code is already, 200 OK. So there is no need to set it twice. That the error handler in the bootstrapper. Instead of return a 'default' InternalServerError status, it's way better to keep returning the original exception. In more complicated nancy applications it's possible that the bootstrapper gets inherited multiple times and each inherited implementation can do it's own error handling. When nancy doesn't receive an exception back, it assumes the error is dealth with and the traversal of the bootstrapper three is stopped resulting in that any other error handlers will not be called. So, only handle you're own exceptions... Great work on this tutorial which gives a quick overview of how Nancy works. When I got an new dev on my team that has to work with Nancy I will them view this tutorial. We're a bit anal about the massive SOLID violations of the ASP.NET MVC / WebAPI (which is not an API, but more like an remote data backend!) so we write all our websites using Nancy..
Рамазан Алисханов you can use any of the view engines you listed it's quite modular. There's even a more primitive view engine which I've used on occassion
pradeep rao no real reason for everything to be in the constructor, just shows how concise nancy can be at the extreme. Would recommend pulling out bits into methods for anything sophisticated. Maybe even different modules.
Thanks for this. I've tried Nancy a couple of times in very simple ways and this clarified a few things for me.
Just a few quick remarks. If an (routed) path exists the nancy application, the default http status code is already, 200 OK. So there is no need to set it twice.
That the error handler in the bootstrapper. Instead of return a 'default' InternalServerError status, it's way better to keep returning the original exception. In more complicated nancy applications it's possible that the bootstrapper gets inherited multiple times and each inherited implementation can do it's own error handling. When nancy doesn't receive an exception back, it assumes the error is dealth with and the traversal of the bootstrapper three is stopped resulting in that any other error handlers will not be called. So, only handle you're own exceptions...
Great work on this tutorial which gives a quick overview of how Nancy works. When I got an new dev on my team that has to work with Nancy I will them view this tutorial. We're a bit anal about the massive SOLID violations of the ASP.NET MVC / WebAPI (which is not an API, but more like an remote data backend!) so we write all our websites using Nancy..
Thanks for the tips duly noted.
Thanks for introducing me to Nancy.
Very nice introduction. I hope you do more.
Hi. How nency working with view engines like razor || webforms?
Рамазан Алисханов you can use any of the view engines you listed it's quite modular. There's even a more primitive view engine which I've used on occassion
Dan Swain
Ok. Something like "return View()" ?
you lost be half way through the bootstrapper config :)
Awosome .. Hope you can show us stateless auth too :)
Why is everything done in the constructor of the class?
pradeep rao no real reason for everything to be in the constructor, just shows how concise nancy can be at the extreme. Would recommend pulling out bits into methods for anything sophisticated. Maybe even different modules.
awesome!
Very Nancy :)