Skip to content
Permalink
Browse files

adding static file

  • Loading branch information
ignatandrei committed Dec 25, 2019
1 parent db1f942 commit 4deb32528aee7b667f22a38c8e96899052cbfd4c
Showing with 23 additions and 10 deletions.
  1. +12 −10 InfoValutar/InfoValutarWebAPI/Startup.cs
  2. +11 −0 InfoValutar/InfoValutarWebAPI/wwwroot/index.html
@@ -86,7 +86,9 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
}

app.UseHttpsRedirection();

app.UseDefaultFiles();
app.UseStaticFiles();

app.UseRouting();

app.UseAuthorization();
@@ -111,15 +113,15 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

}
//maybe do with https://docs.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-3.0
app.Use(async (context, next) =>
{
if (context.Request.Path == "/")
{
context.Response.Redirect("/swagger");
return;
}
await next.Invoke();
});
//app.Use(async (context, next) =>
//{
// if (context.Request.Path == "/")
// {
// context.Response.Redirect("/swagger");
// return;
// }
// await next.Invoke();
//});

var sa = app.ServerFeatures.Get<IServerAddressesFeature>();
var urls =string.Join(",", sa.Addresses.Select(it => it + "/swagger"));
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
You could see the
<a target="_blank" href="https://infovalutar.azurewebsites.net/swagger/index.html">swagger</a>
</body>
</html>

0 comments on commit 4deb325

Please sign in to comment.
You can’t perform that action at this time.