Created
March 7, 2016 00:39
-
-
Save markryd/f6d1eec3c9b4689c254f to your computer and use it in GitHub Desktop.
Run Nancy in Linqpad
This file contains 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
// nuget in Nancy and Nancy.Hosting.Self | |
void Main() | |
{ | |
using (var host = new Nancy.Hosting.Self.NancyHost(new Uri("http://localhost:8080"), new LinqpadNancyBootstrapper())) | |
{ | |
host.Start(); | |
Console.ReadLine(); | |
} | |
} | |
public class HelloModule : Nancy.NancyModule | |
{ | |
public HelloModule() : base("api") | |
{ | |
Get["/"] = parameters => "Hello World"; | |
} | |
} | |
public class LinqpadNancyBootstrapper : Nancy.DefaultNancyBootstrapper | |
{ | |
protected override void ConfigureApplicationContainer(Nancy.TinyIoc.TinyIoCContainer container) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment