First Encounter Nancy

Source: Internet
Author: User

Original address

Nancy is a lightweight, low-threshold framework for the. NET and mono to build HTTP-based services. The goal of this framework is to keep it as simple as possible and provide a super-duper-happy-path for all interactions.

Nancy is designed to handle delete,, OPTIONS, POST, put, and patch requests, and provides a simple, elegant domain-specific language (DSL) for returning responses with just a few lines of code, giving you more important things to focus on in the world. Your code and your application.

Write your application

 Public class module:nancymodule{    public  Module ()    {        get["/greet/{name}  "] = x = =            {returnstring. Concat ("", X.name);}        ;}    }

Compile, run, and enjoy this simple and elegant design.

Characteristics
    • Build from the bottom, not the DSL on an existing framework. Removes the limitations of the underlying framework and references more assemblies than you need. Maintain light weight.
    • Run arbitrarily. Nancy is not built on a specific bearer technology and can run in any environment. The difference is that Nancy supports running under Aspnet/iis, WCF, self-hosting and Owin
    • Super lightweight GET, HEAD, PUT, POST, DELETE, OPTIONS and PATCH request Action statement
    • The integration of the View engine (Razor, Spark, Dotliquid, our own supersimpleviewengine, and many others)
    • Includes the request path matching in the advanced parameter can. Path matching policies can be replaced with custom implementations based on your needs
    • The simple response syntax allows you to return like int, string, HttpStatusCode and Action without explicit conversion or wrapper response-you just need to return it, and Nancy will do the rest for you.
    • Powerful, lightweight testing framework to help you validate your application's behavior
    • Content negotiation
    • There are many many
The Super-duper-happy-path
    • "Super-duper-happy-path" is a phrase made up of the author that describes Nancy's features, and assumes that the "Super-duper-happy-path" experience is what we strive for for all APIs
    • Although it is difficult to give its exact meaning, it is after all an exciting term, followed by the following basic ideas include:
    • He will work normally-you don't need to learn too much, you don't need to tidy up to use it. Add a new module? That will be discovered automatically. Introducing a new view engine? Everything is assembled and ready to move on without you having to do anything. Even if you add a new dependency to your module, by default we will locate the dependency and then help you inject it-no configuration required
    • Easy personalization-despite "it just works", there should be no barriers to personalization. Like using another container? No problem. Want to adjust the way routing is selected? Do it, though! All of these things are a piece of cake by the way of bootstrapper.
    • Low threshold-The number of Nancy code you need in your program is minimal. The most general part of any Nancy program is your code. Our code hinders you and he will help you build amazing apps. As a proof of this, the Nnacy application can be integrated into a single tweet.
    • Low resistance-when building software with Nancy, these APIs will help you achieve what you want, not hinder you. The naming is also obvious and the desired configuration is minimal, but the power and scalability are still there.

In summary, creating an app with Nancy is a pleasant and interesting thing! But when your app grows, it doesn't sacrifice performance and scalability.

Translation is very lame, there is no understanding can refer to the original text.

First Encounter Nancy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.