From 872dc1edbaa15635444595b40661f259dac3e998 Mon Sep 17 00:00:00 2001 From: "jason.zhu" Date: Wed, 21 Apr 2021 23:16:01 +1000 Subject: [PATCH] Serving Your First File * Understand how to serve index.html * Understand how to configure default html page --- DutchTreat/DutchTreat.csproj | 8 ++++++++ DutchTreat/Startup.cs | 6 ++---- DutchTreat/wwwroot/index.html | 10 ++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 DutchTreat/wwwroot/index.html diff --git a/DutchTreat/DutchTreat.csproj b/DutchTreat/DutchTreat.csproj index 92605c5..71d2e18 100644 --- a/DutchTreat/DutchTreat.csproj +++ b/DutchTreat/DutchTreat.csproj @@ -4,4 +4,12 @@ netcoreapp3.1 + + + + + + + + diff --git a/DutchTreat/Startup.cs b/DutchTreat/Startup.cs index 44652ec..ae14ccf 100644 --- a/DutchTreat/Startup.cs +++ b/DutchTreat/Startup.cs @@ -21,10 +21,8 @@ namespace DutchTreat // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { - app.Run(async context => - { - await context.Response.WriteAsync("

Hello World!

"); - }); + app.UseDefaultFiles(); + app.UseStaticFiles(); } } } diff --git a/DutchTreat/wwwroot/index.html b/DutchTreat/wwwroot/index.html new file mode 100644 index 0000000..15245a2 --- /dev/null +++ b/DutchTreat/wwwroot/index.html @@ -0,0 +1,10 @@ + + + + + Dutch Treat + + +

Dutch Treat

+ + \ No newline at end of file