Skip to content

Instantly share code, notes, and snippets.

@mrstebo
Created June 2, 2020 15:19
Show Gist options
  • Select an option

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

Select an option

Save mrstebo/c1d7d97b9217c5adc8d185f718087dbb to your computer and use it in GitHub Desktop.
getting-started-building-simple-nancy-api-2
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