Skip to content

Instantly share code, notes, and snippets.

@dcomartin dcomartin/module.cs
Created Sep 13, 2018

What would you like to do?
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
You can’t perform that action at this time.