only map root routes once

This commit is contained in:
Tommy Parnell
2017-03-02 18:15:39 -05:00
parent 3eb6be2cbd
commit ca669c931f

View File

@@ -41,6 +41,11 @@ namespace aka.terribledev.io
app.UseRouter(a=>{
foreach(var route in Routes.RoutesDictionary)
{
a.MapGet(route.Key, handler: async b=>{
b.Response.Redirect(route.Value, true);
});
}
a.MapVerb("HEAD", "", async b =>{
b.Response.StatusCode = 200;
});
@@ -48,10 +53,6 @@ namespace aka.terribledev.io
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);
});
}
});
}
}