Created
January 28, 2015 11:30
-
-
Save AlbertoMonteiro/20d8a8d667d764acca0f to your computer and use it in GitHub Desktop.
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 System; | |
| using System.Threading.Tasks; | |
| using Microsoft.Owin.Hosting; | |
| using Nancy; | |
| using Owin; | |
| namespace ConsoleApplication1 | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var url = "http://+:8080"; | |
| using (WebApp.Start<Startup>(url)) | |
| { | |
| Console.WriteLine("Running on {0}", url); | |
| Console.WriteLine("Press enter to exit"); | |
| Console.ReadLine(); | |
| } | |
| } | |
| } | |
| public class HelloModule : NancyModule | |
| { | |
| public HelloModule() | |
| { | |
| Get["/", true] = async (x, ct) => await Task.FromResult("hello"); | |
| } | |
| } | |
| public class Startup | |
| { | |
| public void Configuration(IAppBuilder app) | |
| { | |
| app.UseNancy(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment