Created
June 14, 2011 03:48
-
-
Save kevinswiber/1024274 to your computer and use it in GitHub Desktop.
A simple Tabasco app [https://github.com/kevinswiber/Tabasco/]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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