add get and head

This commit is contained in:
Tommy Parnell
2017-03-01 22:03:35 -05:00
parent fcf4b58c81
commit 3eb6be2cbd

View File

@@ -13,6 +13,8 @@ namespace aka.terribledev.io
{
public class Startup
{
public static byte[] hello = System.Text.Encoding.UTF8.GetBytes("hello");
public static int helloCount = hello.Count();
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
@@ -42,6 +44,10 @@ namespace aka.terribledev.io
a.MapVerb("HEAD", "", async b =>{
b.Response.StatusCode = 200;
});
a.MapVerb("GET", "", async b => {
b.Response.StatusCode = 200;
await b.Response.Body.WriteAsync(Startup.hello, 0, helloCount);
});
a.MapGet(route.Key, handler: async b=>{
b.Response.Redirect(route.Value, true);
});