Skip to content

Commit 18204a9

Browse files
author
Daniel Medin
committed
Serve demo from published webroot
1 parent abf49a2 commit 18204a9

2 files changed

Lines changed: 729 additions & 7 deletions

File tree

BitStoreWeb/BitStoreWeb.Net9/Program.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,7 @@
119119
app.MapControllers();
120120
app.MapGet("/api", () => Results.Redirect("/swagger", permanent: false))
121121
.RequireAuthorization();
122-
app.MapGet("/demo", (IWebHostEnvironment env) =>
123-
{
124-
var demoPath = Path.GetFullPath(Path.Combine(env.ContentRootPath, "..", "..", "testbucket-1-view.html"));
125-
return File.Exists(demoPath)
126-
? Results.File(demoPath, "text/html; charset=utf-8")
127-
: Results.NotFound("Demo page not found.");
128-
});
122+
app.MapGet("/demo", () => Results.Redirect("/demo/index.html", permanent: false));
129123

130124
app.MapControllerRoute(
131125
name: "default",

0 commit comments

Comments
 (0)