Created
September 13, 2018 01:07
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
using System.Threading; | |
using System.Threading.Tasks; | |
using Nancy; | |
public class DemoModule: NancyV1Module | |
{ | |
public DemoModule() | |
{ | |
Get["named", "/sync"] = DoSync; | |
Get["/sync/noname"] = DoSync; | |
Get["named", "/async/named", true] = DoAsync; | |
Get["/async/noname", true] = DoAsync; | |
} | |
private object DoSync(dynamic o) | |
{ | |
return "Hello World"; | |
} | |
private Task<object> DoAsync(dynamic o, CancellationToken token) | |
{ | |
return Task.FromResult("Hello World" as object); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment