Nancy Framework


참조 URL
  1. http://nancyfx.org/
  2. http://samples.nancyfx.org/
  3. https://github.com/NancyFx - Source code
  4. http://www.hanselman.com/blog/OneASPNETNancyTemplatesForVisualStudio.aspx
  5. https://github.com/NancyFx/Nancy/wiki/View-engines
  6. https://github.com/NancyFx/Nancy/wiki/Hosting-Nancy-with-asp.net
  7. http://hoons.net/Board/asptip/Content/50727
  8. http://blogs.lessthandot.com/index.php/All/nancy:



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 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.. your code and your application.


 Nancy는 가볍고, 작은 격식과 Mono와 .Net의 HTTP 서비스 기반 개발 프레임웍이다. Nancy는 Delete, Get, Head, Options, Post, Put 요청 처리를 간단하고 명쾌하게 처리되도록 디자인 되었다.



 아래 코드는 NancyModule를 상속 받아 '/greet/{name}'로 주소로 요청을 했을 때 해당 값을 리턴하는 예제다. 이렇게 간단하게 Restful을 구현할 수 있는 프레임웍이다.


[코드1] Nancy에 소개된 예제 코드 



[코드2] Hanselman에 소개된 에제 코드



 ASP.NET MVC나 일반적이 MVC 스타일의 프레임웍이다.



[코드3] Hanselman에 소개된 JSON 리턴 예제 코드


 Json으로 리턴되기를 바란다면 '코드3'과 같이 진행하면 될 것이다. 이 밖에도 Nancy.template, Nancy.Website, Nancy.Demo, View Engine 같은 도구나 데모도 있으니 살펴 보기를 바란다. ( https://github.com/NancyFx )

끝으로 ASP.NET과 같이 호스팅을 할 수 있는 페이지 링크로 마무리 하도록 하겠다. 

https://github.com/NancyFx/Nancy/wiki/Hosting-Nancy-with-asp.net )


Features

  • 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. keep it light
  • 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
  • Ultra lightweight action declarations for GET, HEAD, PUT, POST, DELETE, OPTIONS and PATCH requests
  • View engine integration (Razor, Spark, dotLiquid, our own SuperSimpleViewEngine and many more)
  • Powerful request path matching that includes advanced parameter capabilities. The path matching strategy can be replaced with custom implementations to fit your exact needs
  • Easy response syntax, enabling you to return things like int, string, HttpStatusCode and Action elements without having to explicitly cast or wrap your response - you just return it and Nancy will do the work for you
  • A powerful, light-weight, testing framework to help you verify the behavior of your application
  • Content negotiation
  • And much, much more








+ Recent posts