| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
fmms
13年前发布

.NET的微型Web框架 Nancy

Nancy 是一个轻量级用于构建基于 HTTP 的 Web 服务,基于 .NET 和 Mono 平台。

Nancy 设计用于处理 DELETE, GET, HEAD, OPTIONS, POST, PUT 和 PATCH 等请求方法,并提供简单优雅的 DSL 以返回响应。它具有以下特性:

  • 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 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, NDjango, dotLiquid and our own SuperSimpleViewEngine)
  • 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

示例代码:

public class Module : NancyModule  {      public Module()      {          Get["/greet/{name}"] = x => {              return string.Concat("Hello ", x.name);          };      }  }

项目主页:http://www.open-open.com/lib/view/home/1333591279749

 本文由用户 fmms 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1333591279749.html
.NET Web框架