Benefits of using NancyFx?

Jaggu picture Jaggu · Jul 11, 2012 · Viewed 29.6k times · Source

There is yet another framework for making HTTP calls called NancyFx. My question is what are the benefits of using it. I had quick look at the documentation:

https://github.com/NancyFx/Nancy/wiki/Documentation

and it looks like there is no outstanding feature due to which I would like to use this. What are the benefits of using it over WebHttp?

P.S: I keep reading about some strange phrase that keep repeating again and again "super-duper-happy-path". Is there anything apart from this "super-duper-happy-path"? Any real features implemented?

Answer

Glenn Ferrie picture Glenn Ferrie · Jul 11, 2012

It appears that it offers a different approach to defining "routes" (in the MVC sense) using lambdas to identify relative paths, arguments, and the implementation of the response.

Ultimately, the framework's key benefit is its expressiveness. In ASP.NET MVC the RouteTable is in the global.asax and the implementation is in the Control. It appears that in NancyFx, this is the pattern that prevails:

Action["/path"] = args => { return your_implementation_here; }

Example implementation:

Get["/products"] = id => { return GetRepository().Products.Single( q => q.Id == id); };

Explanation: An HTTP Get to the relative endpoint '/products' with an argument of 'Id' will return a single product from the repository where the Id argument matches the product's Id.

Expressive and Concise.