CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

Nancy

83 Views
Copy Code Show/Hide Line Numbers
Get["/"] = x => {
    return "This is the root";
};
 
Get["/Greet"] = x => {
    return "Hello World";
};
 
Get["/Greet/{name}"] = x => {
    return "Hello " + x.name;
};
 
Get["/404"] = x => {
    return 404;
};
 
Get["/json"] = x => {
 
    var p = new Foo { Age = 122, Name = "Bar" };
 
    return new JsonResult<Foo>(p);
};
 
Get["/navigation/{path}/show/title={name}"] = x => {
    return "Complex route was macthed with path : " + x.path + " and title : " + x.name;
};
by TheCodeJunkie
  September 01, 2010 @ 1:23am

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate