Skip to content

Instantly share code, notes, and snippets.

@gdelca5 gdelca5/c#
Created Jan 26, 2015

Embed
What would you like to do?
Nancy RedirectResponse
using Nancy;
public class IndexModule : Nancy.NancyModule
{
public IndexModule()
{
Get["/"] = parameters =>
{
return new RedirectResponse("http://localhost:9000/");
};
}
}
public class RedirectResponse : Response
{
public RedirectResponse(string location)
{
this.Headers.Add("Location", location);
this.Contents = GetStringContents(string.Empty);
this.ContentType = "text/html";
this.StatusCode = HttpStatusCode.SeeOther;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.