Skip to content

Instantly share code, notes, and snippets.

@thecodejunkie
Created November 23, 2011 07:53
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 thecodejunkie/1388141 to your computer and use it in GitHub Desktop.
Save thecodejunkie/1388141 to your computer and use it in GitHub Desktop.
Extending Nancy to support additional request verbs
public abstract class CustomRequestVerbsModule : NancyModule
{
protected CustomRequestVerbsModule()
{
}
protected CustomRequestVerbsModule(string modulePath): base(modulePath)
{
}
public RouteBuilder Trace
{
get { return new RouteBuilder("TRACE", this); }
}
}
public class CustomRequestVerbsTestModule : CustomRequestVerbsModule
{
public CustomRequestVerbsTestModule()
{
Trace["/"] = _ =>{
return 200;
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment