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