Created
February 15, 2013 14:04
-
-
Save grumpydev/4960559 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| namespace NancyKatana | |
| { | |
| using System; | |
| using System.Threading.Tasks; | |
| using Nancy; | |
| using NancyKatana.Models; | |
| public class WhyDoIAlwaysCallTheseThingsMainModule : NancyModule | |
| { | |
| public WhyDoIAlwaysCallTheseThingsMainModule() | |
| { | |
| Get["/"] = _ => "Hello!"; | |
| Get["/async", true] = async _ => | |
| { | |
| await Task.Delay(500); | |
| return "Done!"; | |
| }; | |
| Get["/greet/{name?Nancy}"] = x => new User { Name = x.Name }; | |
| Get["/error1"] = x => View["nope"]; | |
| Get["/error2"] = x => { throw new Exception("merp"); }; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment