Skip to content

Instantly share code, notes, and snippets.

@markryd
Created March 7, 2016 00:39
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markryd/f6d1eec3c9b4689c254f to your computer and use it in GitHub Desktop.
Save markryd/f6d1eec3c9b4689c254f to your computer and use it in GitHub Desktop.
Run Nancy in Linqpad
// 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