Skip to content

Commit

Permalink
Configuring middleware: serving static files
Browse files Browse the repository at this point in the history
  • Loading branch information
gorohoroh committed Jul 3, 2018
1 parent 032855d commit 94d61f8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions OdeToFoodRider/OdeToFoodRider/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, IGreeter
app.UseDeveloperExceptionPage();
}

app.UseFileServer();

app.Run(async (context) =>
{
Expand Down
11 changes: 11 additions & 0 deletions OdeToFoodRider/OdeToFoodRider/wwwroot/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My default file</title>
</head>
<body>
<div>This is Rider's index.html!</div>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions OdeToFoodVisualStudio/OdeToFoodVisualStudio/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, IGreeter
app.UseDeveloperExceptionPage();
}

app.UseFileServer();

app.Run(async (context) =>
{
Expand Down
10 changes: 10 additions & 0 deletions OdeToFoodVisualStudio/OdeToFoodVisualStudio/wwwroot/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<div>This is index.html!</div>
</body>
</html>

0 comments on commit 94d61f8

Please sign in to comment.