From 3eb6be2cbdc1296c5bca53c5a44f78b41dbaedf7 Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Wed, 1 Mar 2017 22:03:35 -0500 Subject: [PATCH] add get and head --- Startup.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Startup.cs b/Startup.cs index 06a0ba7..f754025 100644 --- a/Startup.cs +++ b/Startup.cs @@ -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); });