Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 142 lines (108 sloc) 7.56 kb
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
1 # Meet Nancy
2
9754732 @thecodejunkie Made additional changes to the readm.. included information about the Na...
thecodejunkie authored
3 Nancy is a lightweight web framework for the .Net platform, inspired by Sinatra. Nancy aims to deliver a low ceremony approach to building light, fast web applications.
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
4
5 ## Features
6
807b5cc @GraemeF Fixed some typos.
GraemeF authored
7 * 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_
0c290c9 @thecodejunkie Updated readme file
thecodejunkie authored
8 * Abstracted away from ASP.NET / IIS so that it can run on multiple hosting environments (planned [OWIN](http://bvanderveen.com/a/dotnet-http-abstractions "Read more about the Open Web Interface for .NET") support), such as (but not limited to) ASP.NET, WCF, Mono/FastCGI and more (ASP.NET and WCF currently supported out-of-the-box)
4ece39e @thecodejunkie Updated readme.mb to contain information about HEAD requests being suppo...
thecodejunkie authored
9 * Ultra lightweight action declarations for GET, HEAD, PUT, POST and DELETE requests
0c290c9 @thecodejunkie Updated readme file
thecodejunkie authored
10 * View engine integration
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
11 * Powerful request path matching that includes advanced parameter capabilities. The path matching strategy can be replaced with custom implementations to fit your exact needs
12 * Easy response syntax, enabling you to return things like int, string, HttpStatusCode and Action<Stream> elements without having to explicitly cast or wrap your response - you just return it and Nancy _will_ do the work for you
13
14 ## Usage
15
807b5cc @GraemeF Fixed some typos.
GraemeF authored
16 Set up your web.config file:
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
17
18 <httpHandlers>
19 <add verb="*" type="Nancy.Hosting.NancyHttpRequestHandler" path="*"/>
20 </httpHandlers>
21
22 <system.webServer>
23 <validation validateIntegratedModeConfiguration="false"/>
24 <handlers>
25 <add name="Nancy" verb="*" type="Nancy.Hosting.NancyHttpRequestHandler" path="*"/>
26 </handlers>
27 </system.webServer>
28
807b5cc @GraemeF Fixed some typos.
GraemeF authored
29 Start adding your Nancy modules containing your actions:
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
30
31 public class Module : NancyModule
32 {
9158f86 @thecodejunkie Added module path example to readme file
thecodejunkie authored
33 public Module()
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
34 {
35 Get["/"] = x => {
36 return "This is the root";
37 };
38 }
39 }
40
807b5cc @GraemeF Fixed some typos.
GraemeF authored
41 Start your application and enjoy! Swap out Get with either Put, Post or Delete to create actions that will respond to calls using those request methods.
0d2e68f @thecodejunkie Added action parameter example to readme file
thecodejunkie authored
42
807b5cc @GraemeF Fixed some typos.
GraemeF authored
43 If you want to get fancy you can add parameters to your paths:
0d2e68f @thecodejunkie Added action parameter example to readme file
thecodejunkie authored
44
45 public class Module : NancyModule
46 {
9158f86 @thecodejunkie Added module path example to readme file
thecodejunkie authored
47 public Module()
0d2e68f @thecodejunkie Added action parameter example to readme file
thecodejunkie authored
48 {
49 Get["/greet/{name}"] = x => {
50 return string.Concat("Hello ", x.name);
51 };
52 }
53 }
54
55 The _{name}_ parameter will be captured and injected into the action parameters, shown as _x_ in the sample. The parameters are represented by a _dynamic_ type so you can access any parameter name straight on it as a property or an indexer. For more information on action parameters please refer to the [Nancy introduction post](http://elegantcode.com/2010/11/28/introducing-nancy-a-lightweight-web-framework-inspired-by-sinatra "Read the Nancy introduction post at elegantcode.com") over at my blog on [ElegantCode](http://elegantcode.com "Visit ElegantCode).
9158f86 @thecodejunkie Added module path example to readme file
thecodejunkie authored
56
807b5cc @GraemeF Fixed some typos.
GraemeF authored
57 Nancy also supports the idea of _module paths_, where you assign a root path for all actions in the module and they will all be relative to that:
9158f86 @thecodejunkie Added module path example to readme file
thecodejunkie authored
58
59 public class Module : NancyModule
60 {
61 public Module() : base("/butler")
62 {
63 Get["/greet/{name}"] = x => {
64 return string.Concat("Hello ", x.name);
65 };
66 }
67 }
68
69 Notice the _base("/butler")_ call to the NancyModule constructor. Now all action paths that are defined in the module will be relative to _/butler_ so in order to greet someone you could access _/butler/greet/{name}_, for example _/butler/greet/thecodejunkie_
fdd4783 @thecodejunkie Updated readme to contain information about the third party bootstrapper...
thecodejunkie authored
70
71 ## Bootstrappers
72
73 The bootstrapper projects for third party IoC containers are only temporarily in the source code. These will be removed when the IoC integration design has been proven stable. They will be moving into a contrib-style project and/or the Nancy wiki. The reason they
74 won't ship with Nancy is because we do not want to be tasked each time there is a new version of the containers released.
75
9754732 @thecodejunkie Made additional changes to the readm.. included information about the Na...
thecodejunkie authored
76 ## Community
77
6a018b6 @thecodejunkie Fixed typo in readme
thecodejunkie authored
78 You can find lot of Nancy users on the [Nancy User Group](https://groups.google.com/forum/?fromgroups#forum/nancy-web-framework). That is where most of the discussions regarding the development and usage of Nancy is taking place. You can also
9754732 @thecodejunkie Made additional changes to the readm.. included information about the Na...
thecodejunkie authored
79 find Nancy on Twitter using the #NancyFx hashtag.
80
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
81 ## Help out
82
807b5cc @GraemeF Fixed some typos.
GraemeF authored
83 There are many ways you can contribute to Nancy. Like most open-source software projects, contributing code
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
84 is just one of many outlets where you can help improve. Some of the things that you could help out with in
807b5cc @GraemeF Fixed some typos.
GraemeF authored
85 Nancy are:
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
86
87 * Documentation (both code and features)
88 * Bug reports
89 * Bug fixes
90 * Feature requests
91 * Feature implementations
92 * Test coverage
93 * Code quality
94 * Sample applications
95
4104ee8 @thecodejunkie Updated readme file with information about view engine integrations
thecodejunkie authored
96 ## View Engines
97
98 There is a rich set of view engines in the .net space and most of them have been design in such a away that they are framework agnostic, all that is needed is a bit
0c290c9 @thecodejunkie Updated readme file
thecodejunkie authored
99 of integration work to get it running in Nancy. Currently there are support for [Razor](http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx "Read more about the Razor view engine"),
100 [Spark](http://sparkviewengine.com "Read more about the Spark view engine"), [NDjango](http://ndjango.org "Read more about the NDjango view engine") and a static file engine. There used to be an [NHaml](http://code.google.com/p/nhaml "Read more about the NHaml view engine")
101 engine but it was removed since the view engine project appears to have come to a dead halt. Let us know if that change! WebForms engine.. well let's just say that if you have a need to use WebForms with Nancy then _we accept patches_!
4104ee8 @thecodejunkie Updated readme file with information about view engine integrations
thecodejunkie authored
102
0c290c9 @thecodejunkie Updated readme file
thecodejunkie authored
103 All view engine integrations are still very early implementations and more work will be put towards them to bring as many of the features, as possible, into Nancy! If you have any experience with either of the engines, grab a fork and start coding!
4104ee8 @thecodejunkie Updated readme file with information about view engine integrations
thecodejunkie authored
104
f485d79 @thecodejunkie Added contributor section to readme file
thecodejunkie authored
105 ## Contributors
106
79557ef @thecodejunkie Integrated contributions by Johan Danforth
thecodejunkie authored
107 Nancy is not a one man project and many of the features that are availble would not have been possible without the awesome contributions from the community!
8b348e2 @thecodejunkie Updated contributors text in the readme file
thecodejunkie authored
108
96f6d2c @thecodejunkie Updated contributor section, of the readme, with links to their github p...
thecodejunkie authored
109 * [Andy Pike](http://github.com/andypike)
c672fa5 @thecodejunkie Updated list of contributors in the readme
thecodejunkie authored
110 * [Bjarte Djuvik Næss](http://github.com/bjartn)
712c424 @thecodejunkie Added Chris Nicola to list of contributors
thecodejunkie authored
111 * [Chris Nicola](http://github.com/lucisferre)
33f135d @thecodejunkie Added David Hong to list of contributors
thecodejunkie authored
112 * [David Hong](http://github.com/davidhong)
96f6d2c @thecodejunkie Updated contributor section, of the readme, with links to their github p...
thecodejunkie authored
113 * [Graeme Foster](http://github.com/GraemeF)
114 * [Ian Davis](http://github.com/innovatian)
c672fa5 @thecodejunkie Updated list of contributors in the readme
thecodejunkie authored
115 * [Jonas Cannehag](http://github.com/knecke)
96f6d2c @thecodejunkie Updated contributor section, of the readme, with links to their github p...
thecodejunkie authored
116 * [José F. Romaniello](http://github.com/jfromaniello)
117 * [Karl Seguin](http://github.com/karlseguin)
118 * [James Eggers](http://github.com/jameseggers1)
119 * [Jason Mead](http://github.com/meadiagenic)
120 * [Jeremy Skinner](http://github.com/jeremyskinner)
121 * [João Bragança](http://github.com/joaobraganca)
122 * [Johan Danforth](http://github.com/johandanforth)
123 * [John Downey](http://github.com/jtdowney)
3505dff @thecodejunkie Added Maciej Kowalewski to list of contributors
thecodejunkie authored
124 * [Maciej Kowalewski](http://github.com/maciejk)
9993aee @mmozuras Fixed my name (just one macron missing) in readme.md
mmozuras authored
125 * [Mindaugas Mozûras](http://github.com/mmozuras)
96f6d2c @thecodejunkie Updated contributor section, of the readme, with links to their github p...
thecodejunkie authored
126 * [Pedro Felix](http://github.com/pmhsfelix)
127 * [Piotr Wlodek](http://github.com/pwlodek)
128 * [Phil Haack](http://github.com/haacked)
129 * [Robert Greyling](http://github.com/robertthegrey)
130 * [Steven Robbins](http://github.com/grumpydev)
c7d24ca @thecodejunkie Added Thomas Pedersen to list of contributors
thecodejunkie authored
131 * [Thomas Pedersen](http://github.com/thedersen)
c672fa5 @thecodejunkie Updated list of contributors in the readme
thecodejunkie authored
132 * [Troels Thomsen](http://github.com/troethom)
96f6d2c @thecodejunkie Updated contributor section, of the readme, with links to their github p...
thecodejunkie authored
133 * [Vidar L. Sømme](http://github.com/vidarls)
8c5ad0e @thecodejunkie Updated readme file with information about view engine integrations
thecodejunkie authored
134
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
135 ## Copyright
136
4c59b80 @thecodejunkie Updated copyright section of the readme
thecodejunkie authored
137 Copyright © 2010 Andreas Håkansson and contributors
bf81f16 @thecodejunkie Updated readme file to markdown syntax and added contents
thecodejunkie authored
138
139 ## License
140
9993aee @mmozuras Fixed my name (just one macron missing) in readme.md
mmozuras authored
141 Nancy is licensed under [MIT](http://www.opensource.org/licenses/mit-license.php "Read more about the MIT license form"). Refer to license.txt for more information.
Something went wrong with that request. Please try again.