{"id":7904,"date":"2015-11-07T14:41:33","date_gmt":"2015-11-07T14:41:33","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/07\/nancyfx-nancy\/"},"modified":"2015-11-07T14:41:33","modified_gmt":"2015-11-07T14:41:33","slug":"nancyfx-nancy","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/07\/nancyfx-nancy\/","title":{"rendered":"NancyFx\/Nancy"},"content":{"rendered":"<p>Nancy is a lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono. The goal of the framework is to stay out of the way as much as possible and provide a super-duper-happy-path to all interactions.<\/p>\n<p>Nancy is designed to handle <code>DELETE<\/code>, <code>GET<\/code>, <code>HEAD<\/code>, <code>OPTIONS<\/code>, <code>POST<\/code>, <code>PUT<\/code> and <code>PATCH<\/code> requests and provides a simple, elegant, Domain Specific Language (DSL) for returning a response with just a couple of keystrokes, leaving you with more time to focus on the important bits\u2026 <strong>your<\/strong> code and <strong>your<\/strong> application.<\/p>\n<p>Write your application<\/p>\n<pre><code>public class Module : NancyModule\n{\n    public Module()\n    {\n        Get[\"\/greet\/{name}\"] = x =&gt; {\n            return string.Concat(\"Hello \", x.name);\n        };\n    }\n}\n<\/code><\/pre>\n<p>Compile, run and enjoy the simple, elegant design!<\/p>\n<h2>Features<\/h2>\n<ul>\n<li>Built from the bottom up, not simply a DSL on top of an existing framework. Removing limitations and feature hacks of an underlying framework, as well as the need to reference more assemblies than you need. <em>keep it light<\/em><\/li>\n<li>Run anywhere. Nancy is not built on any specific hosting technology can be run anywhere. Out of the box, Nancy supports running on ASP.NET\/IIS, WCF, Self-hosting and any OWIN<\/li>\n<li>Ultra lightweight action declarations for GET, HEAD, PUT, POST, DELETE, OPTIONS and PATCH requests<\/li>\n<li>View engine integration (Razor, Spark, dotLiquid, our own SuperSimpleViewEngine and many more)<\/li>\n<li>Powerful request path matching that includes advanced parameter capabilities. The path matching strategy can be replaced with custom implementations to fit your exact needs<\/li>\n<li>Easy response syntax, enabling you to return things like int, string, HttpStatusCode and Action elements without having to explicitly cast or wrap your response &#8211; you just return it and Nancy <em>will<\/em> do the work for you<\/li>\n<li>A powerful, light-weight, testing framework to help you verify the behavior of your application<\/li>\n<li>Content negotiation<\/li>\n<li>And much, much more<\/li>\n<\/ul>\n<h2>The super-duper-happy-path<\/h2>\n<p>The \u201csuper-duper-happy-path\u201d (or SDHP if you\u2019re \u2018down with the kids\u2019 ;-)) is a phrase we coined to describe the ethos of Nancy; and providing the \u201csuper-duper-happy-path\u201d experience is something we strive for in all of our APIs.<\/p>\n<p>While it\u2019s hard to pin down exactly what it is, it\u2019s a very emotive term after all, but the basic ideas behind it are:<\/p>\n<ul>\n<li>\u201cIt just works\u201d &#8211; you should be able to pick things up and use them without any mucking about. Added a new module? That\u2019s automatically discovered for you. Brought in a new View Engine? All wired up and ready to go without you having to do anything else. Even if you add a new dependency to your module, by default we\u2019ll locate that and inject it for you &#8211; no configuration required.<\/li>\n<li>\u201cEasily customisable\u201d &#8211; even though \u201cit just works\u201d, there shouldn\u2019t be any barriers that get in the way of customisation should you want to work the way you want to work with the components that you want to use. Want to use another container? No problem! Want to tweak the way routes are selected? Go ahead! Through our bootstrapper approach all of these things should be a piece of cake.<\/li>\n<li>\u201cLow ceremony\u201d &#8211; the amount of \u201cNancy code\u201d you should need in your application should be minimal. The important part of any Nancy application is your code &#8211; our code should get out of your way and let you get on with building awesome applications. As a testament to this it\u2019s actually possible to fit a functional Nancy application into a single Tweet \ud83d\ude42<\/li>\n<li>\u201cLow friction\u201d &#8211; when building software with Nancy the APIs should help you get where you want to go, rather than getting in your way. Naming should be obvious, required configuration should be minimal, but power and extensibility should still be there when you need it.<\/li>\n<\/ul>\n<p>Above all, creating an application with Nancy should be a pleasure, and hopefully fun! But without sacrificing the power or extensibility that you may need as your application grows.<\/p>\n<h2>Community<\/h2>\n<p>Nancy followers can be found in the JabbR #NancyFX room. You can also find Nancy on Twitter using the #NancyFx hashtag.<\/p>\n<h2>Help out<\/h2>\n<p>There are many ways you can contribute to Nancy. Like most open-source software projects, contributing code is just one of many outlets where you can help improve. Some of the things that you could help out with in Nancy are:<\/p>\n<ul>\n<li>Documentation (both code and features)<\/li>\n<li>Bug reports<\/li>\n<li>Bug fixes<\/li>\n<li>Feature requests<\/li>\n<li>Feature implementations<\/li>\n<li>Test coverage<\/li>\n<li>Code quality<\/li>\n<li>Sample applications<\/li>\n<\/ul>\n<h2>Contributors<\/h2>\n<p>Nancy is not a one man project and many of the features that are available would not have been possible without the awesome contributions from the community!<\/p>\n<p>For a full list of contributors, please see the website.<\/p>\n<h2>Copyright<\/h2>\n<p>Copyright \u00a9 2010 Andreas H\u00e5kansson, Steven Robbins and contributors<\/p>\n<h2>License<\/h2>\n<p>Nancy is licensed under MIT. Refer to license.txt for more information.<\/p>\n<h2>CI Builds<\/h2>\n<h3>TC (.net)<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/nancy-ci.cloudapp.net\/app\/rest\/builds\/buildType:%28id:Nancy_NancyMaster%29\/statusIcon\" \/><\/p>\n<h3>Travis (Mono 2.x)<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/travis-ci.org\/NancyFx\/Nancy.png?branch=master\" \/><\/p>\n<h3>TC (Mono 2.x)<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/nancy-ci.cloudapp.net\/app\/rest\/builds\/buildType:%28id:Nancy_NancyMasterMono2x%29\/statusIcon\" \/><\/p>\n<h3>TC (Mono 3.x)<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/nancy-ci.cloudapp.net\/app\/rest\/builds\/buildType:%28id:Nancy_NancyMasterMono3x%29\/statusIcon\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nancy is a lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono. The goal of the framework is to stay out of the way as much as possible and provide a super-duper-happy-path to all interactions. Nancy is designed to handle DELETE, GET, HEAD, OPTIONS, POST, PUT and PATCH requests and provides a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7904","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7904"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7904\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}