Skip to content

Instantly share code, notes, and snippets.

@hvitorino
Created April 1, 2012 22:21
Show Gist options
  • Select an option

  • Save hvitorino/2279132 to your computer and use it in GitHub Desktop.

Select an option

Save hvitorino/2279132 to your computer and use it in GitHub Desktop.
nancy module <=> controller
public class Gols : NancyModule
{
public Gols() : base("/gols")
{
Get["/"] = args =>
{
return View["gols.html"];
};
Post["/"] = args =>
{
var gol = this.Bind<Gol>();
return Response.AsJson<Gol>(gol);
};
}
}
public class Gol
{
public string Jogador { get; set; }
public string Time { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment