Created
April 1, 2012 22:21
-
-
Save hvitorino/2279132 to your computer and use it in GitHub Desktop.
nancy module <=> controller
This file contains hidden or 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
| 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