This commit is contained in:
Tommy Parnell
2017-12-12 13:32:42 -05:00
parent 1030c11299
commit 9090cafa4f
3 changed files with 10 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ namespace aka.terribledev.io
public static byte[] hello = System.Text.Encoding.UTF8.GetBytes("hello"); public static byte[] hello = System.Text.Encoding.UTF8.GetBytes("hello");
public static byte[] fourOhFor = System.Text.Encoding.UTF8.GetBytes("404"); public static byte[] fourOhFor = System.Text.Encoding.UTF8.GetBytes("404");
public static int helloCount = hello.Count(); public static int helloCount = hello.Count();
public static byte[] favicon = System.IO.File.ReadAllBytes("favicon.ico");
public static int faviconByteCount = favicon.Count();
public Startup(IHostingEnvironment env) public Startup(IHostingEnvironment env)
{ {
var builder = new ConfigurationBuilder() var builder = new ConfigurationBuilder()
@@ -58,6 +60,11 @@ namespace aka.terribledev.io
}); });
app.UseRouter(a=>{ app.UseRouter(a=>{
a.MapGet("favicon.ico", b=>
{
b.Response.StatusCode = 200;
return b.Response.Body.WriteAsync(favicon, 0, faviconByteCount);
});
foreach(var route in Routes.RoutesDictionary) foreach(var route in Routes.RoutesDictionary)
{ {
a.MapGet(route.Key, handler: async b=>{ a.MapGet(route.Key, handler: async b=>{

View File

@@ -4,6 +4,9 @@
<AssemblyName>aka.terribledev.io</AssemblyName> <AssemblyName>aka.terribledev.io</AssemblyName>
<PackageId>aka.terribledev.io</PackageId> <PackageId>aka.terribledev.io</PackageId>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Content Include="favicon.ico" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" /> <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" /> <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB