Created
August 4, 2014 13:11
-
-
Save etishor/924ee47086222bf9a780 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 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