Created
February 28, 2010 04:55
-
-
Save jacksonh/317220 to your computer and use it in GitHub Desktop.
This file contains 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 System; | |
using System.Collections.Generic; | |
using Kayak; | |
using Kayak.Framework; | |
using Mango.Templates.Minge; | |
public class KayakDemo { | |
public static void Main(string[] args) | |
{ | |
var server = new KayakServer(); | |
Minge.Initialize ("templates"); | |
server.UseFramework (); | |
server.Start (); | |
Console.WriteLine("Kayak is running! Press enter to exit."); | |
Console.ReadLine (); | |
server.Stop (); | |
} | |
public class Views : KayakService | |
{ | |
[Path("/")] | |
public void Root () | |
{ | |
Dictionary<string,object> the_args = new Dictionary<string,object> (); | |
the_args.Add ("views", new string [] { "numbers", "properties" }); | |
Minge.RenderToStream ("root.html", Response.Output, the_args); | |
} | |
[Path("/numbers")] | |
public void Numbers (string word) | |
{ | |
Minge.RenderToStream ("numbers.html", Response.Output); | |
} | |
[Path("/properties")] | |
public void Properties (string word) | |
{ | |
Minge.RenderToStream ("properties.html", Response.Output); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment