🐛 Fix drive web broke
This commit is contained in:
@@ -46,7 +46,7 @@ using (var scope = app.Services.CreateScope())
|
||||
var tusDiskStore = app.Services.GetRequiredService<TusDiskStore>();
|
||||
|
||||
// Configure application middleware pipeline
|
||||
app.ConfigureAppMiddleware(tusDiskStore);
|
||||
app.ConfigureAppMiddleware(tusDiskStore, builder.Environment.ContentRootPath);
|
||||
|
||||
app.MapGatewayProxy();
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using DysonNetwork.Drive.Storage;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using tusdotnet;
|
||||
using tusdotnet.Interfaces;
|
||||
|
||||
@@ -6,7 +7,7 @@ namespace DysonNetwork.Drive.Startup;
|
||||
|
||||
public static class ApplicationBuilderExtensions
|
||||
{
|
||||
public static WebApplication ConfigureAppMiddleware(this WebApplication app, ITusStore tusStore)
|
||||
public static WebApplication ConfigureAppMiddleware(this WebApplication app, ITusStore tusStore, string contentRoot)
|
||||
{
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
@@ -18,6 +19,12 @@ public static class ApplicationBuilderExtensions
|
||||
app.UseAuthorization();
|
||||
app.MapControllers();
|
||||
|
||||
app.UseDefaultFiles();
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(contentRoot, "wwwroot", "dist"))
|
||||
});
|
||||
|
||||
app.MapTus("/api/tus", _ => Task.FromResult(TusService.BuildConfiguration(tusStore, app.Configuration)));
|
||||
|
||||
return app;
|
||||
|
Reference in New Issue
Block a user