Created
April 14, 2014 13:33
-
-
Save laurentkempe/10648289 to your computer and use it in GitHub Desktop.
NancyModule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Router : NancyModule, IRouter | |
{ | |
public Router() | |
: base("/") | |
{ | |
Get["test"] = x => "hello"; | |
} | |
public void HttpGet(string path, Func<dynamic, dynamic> action) | |
{ | |
Get[path] = x => action; | |
} | |
/// <summary> | |
/// Gets all declared routes by the module. | |
/// </summary> | |
/// <value> | |
/// A <see cref="T:System.Collections.Generic.IEnumerable`1"/> instance, containing all <see cref="T:Nancy.Routing.Route"/> instances declared by the module. | |
/// </value> | |
/// <remarks> | |
/// This is automatically set by Nancy at runtime. | |
/// </remarks> | |
public override IEnumerable<Route> Routes | |
{ | |
get { return base.Routes; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment