Skip to content

Instantly share code, notes, and snippets.

@chrisnicola
Created January 24, 2011 04:59
Show Gist options
  • Save chrisnicola/792857 to your computer and use it in GitHub Desktop.
Save chrisnicola/792857 to your computer and use it in GitHub Desktop.
Some example usage of Nancy
public AccountHandler()
{
Get["/accounts/{id}"] = x => { return GetById(x.id); };
Get["/accounts"] = x => { return GetListing(); };
Post["/accounts", req => CanPost(req)] = x => { return CreateNewAccount(Request.Body.FromJson<NewAccountForm>()); };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment