From a8fb74b2c9fa202f344e024f40d5308270fabc45 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 21 Feb 2019 15:26:05 +0000 Subject: Website doesn't display index.html for some reason?? --- Main/Startup.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Main/Startup.cs b/Main/Startup.cs index 6e26943..2722747 100644 --- a/Main/Startup.cs +++ b/Main/Startup.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; @@ -47,12 +48,13 @@ namespace Server { } app.UseDefaultFiles(); - app.UseStaticFiles( - Path.Combine( + string website_path = Path.Combine( Directory.GetParent(Directory.GetCurrentDirectory()).ToString(), - "Website" - ) - ); + "Website"); + app.UseStaticFiles(new StaticFileOptions { + FileProvider = new PhysicalFileProvider(website_path), + RequestPath = "/test" + }); app.UseHangfireDashboard(); app.UseHangfireServer(); -- cgit v1.2.3-13-gbd6f