Skip to content

Instantly share code, notes, and snippets.

@thecodejunkie
Forked from grumpydev/ConNegModule.cs
Created February 24, 2011 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thecodejunkie/841900 to your computer and use it in GitHub Desktop.
Save thecodejunkie/841900 to your computer and use it in GitHub Desktop.
namespace NancyConNegDemo
{
using Extensions;
using Models;
using Nancy;
public class ConNegModule : NancyModule
{
public ConNegModule() : base("/conneg")
{
Get["/"] = x =>
{
var model = new UserModel(Context.Items["username"].ToString());
I.RespondTo(ContentTypes.Html).WithView("MyView")
.RespondTo(ContentTypes.Xml)
.RespondTo(ContentTypes.Json)
.UsingModel(model);
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment