diff --git a/AicsKnowledgeBase_file/Program.cs b/AicsKnowledgeBase_file/Program.cs index 5d1f756..a6a1f4b 100644 --- a/AicsKnowledgeBase_file/Program.cs +++ b/AicsKnowledgeBase_file/Program.cs @@ -2,6 +2,7 @@ using System.Text.Json; using AicsKnowledgeBase_file.Handlers; using AicsKnowledgeBase_file.Models; using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.Extensions.FileProviders; Directory.CreateDirectory("./files"); @@ -41,6 +42,11 @@ if (app.Environment.IsDevelopment()) { app.MapGet("/hello", () => "hello"); +app.UseStaticFiles(new StaticFileOptions { + FileProvider = new PhysicalFileProvider(Path.Combine(builder.Environment.ContentRootPath, "files")), + RequestPath = "/static" +}); + app.UseHttpsRedirection(); app.MapControllers();