Skip to content

Instantly share code, notes, and snippets.

@etishor
Created August 4, 2014 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etishor/924ee47086222bf9a780 to your computer and use it in GitHub Desktop.
Save etishor/924ee47086222bf9a780 to your computer and use it in GitHub Desktop.
using System;
using Nancy;
using Nancy.Hosting.Self;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
using (var host = new NancyHost(new Uri("http://localhost:1234")))
{
host.Start();
Console.ReadKey();
}
}
}
public class TestBootstrapper : DefaultNancyBootstrapper
{
protected override void ApplicationStartup(Nancy.TinyIoc.TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines)
{
base.ApplicationStartup(container, pipelines);
}
}
public class TestModule : NancyModule
{
public TestModule()
: base("/")
{
Get["/test"] = _ =>
{
var response = Response.AsText("test", "application/json");
response.StatusCode = HttpStatusCode.InternalServerError;
return response;
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment