Skip to content

Instantly share code, notes, and snippets.

@mrstebo
Created July 21, 2017 19:53
Show Gist options
  • Select an option

  • Save mrstebo/b19b0081c7a47298f2f35dcbb9bd1736 to your computer and use it in GitHub Desktop.

Select an option

Save mrstebo/b19b0081c7a47298f2f35dcbb9bd1736 to your computer and use it in GitHub Desktop.
A simple Nancy module
using Nancy;
namespace NancyApp
{
public class HomeModule : NancyModule
{
public HomeModule()
: base("/")
{
Get["/"] = Index;
Get["/test"] = _ => Test();
}
private dynamic Index(dynamic parameters)
{
return Response.AsJson(new {Message = "OK"});
}
private dynamic Test()
{
return Response.AsJson(new {Message = "Test"});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment