Created
July 21, 2017 19:53
-
-
Save mrstebo/b19b0081c7a47298f2f35dcbb9bd1736 to your computer and use it in GitHub Desktop.
A simple Nancy module
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