Skip to content

Instantly share code, notes, and snippets.

@kevinswiber
Created June 14, 2011 03:48
Show Gist options
  • Save kevinswiber/1024274 to your computer and use it in GitHub Desktop.
Save kevinswiber/1024274 to your computer and use it in GitHub Desktop.
using NRack.Helpers;
namespace Tabasco.Example.AspNet
{
public class App : TabascoBase
{
[Get]
public IView Index()
{
return new Spark();
}
[Post("/name")]
public IView Name()
{
return new Razor(new { Name = Request.Params["name"] });
}
[Get("/doctor")]
[Get("/doctor/:who")]
public dynamic[] Pepper()
{
var who = Request.Params.ContainsKey(":who") ? Request.Params[":who"] : "you";
return new dynamic[]
{
200,
new Hash { { "Content-Type", "text/plain" } },
"Wouldn't " + who + " like to be a pepper, too?"
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment