add static file serving
This commit is contained in:
@@ -14,6 +14,8 @@ using Microsoft.AspNetCore.Http.Connections;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Prometheus;
|
||||
using WebSocketOptions = Microsoft.AspNetCore.Builder.WebSocketOptions;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MareSynchronosServer
|
||||
{
|
||||
@@ -78,6 +80,7 @@ namespace MareSynchronosServer
|
||||
}
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.UseHttpLogging();
|
||||
|
||||
app.UseRouting();
|
||||
var webSocketOptions = new WebSocketOptions
|
||||
@@ -85,6 +88,13 @@ namespace MareSynchronosServer
|
||||
KeepAliveInterval = TimeSpan.FromSeconds(10),
|
||||
};
|
||||
|
||||
app.UseStaticFiles(new StaticFileOptions()
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(Configuration["CacheDirectory"]),
|
||||
RequestPath = "/cache",
|
||||
ServeUnknownFileTypes = true
|
||||
});
|
||||
|
||||
app.UseHttpMetrics();
|
||||
app.UseWebSockets(webSocketOptions);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user