Serving Your First File
* Understand how to serve index.html * Understand how to configure default html pagevs2019/2_Getting_Started
parent
f2cba0c19e
commit
872dc1edba
|
@ -4,4 +4,12 @@
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="wwwroot\index.html" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="wwwroot\css\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -21,10 +21,8 @@ namespace DutchTreat
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
{
|
{
|
||||||
app.Run(async context =>
|
app.UseDefaultFiles();
|
||||||
{
|
app.UseStaticFiles();
|
||||||
await context.Response.WriteAsync("<html><body><h1>Hello World!</h1></body></html>");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Dutch Treat</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Dutch Treat</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue