feat: enable serving unknown file types in static files middleware
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
using ASTRAIN.Api.Data;
|
using ASTRAIN.Api.Data;
|
||||||
using ASTRAIN.Api.Endpoints;
|
using ASTRAIN.Api.Endpoints;
|
||||||
|
using Microsoft.AspNetCore.StaticFiles;
|
||||||
|
using Microsoft.Extensions.FileProviders;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
@@ -42,7 +44,12 @@ if (app.Environment.IsDevelopment())
|
|||||||
// app.UseHttpsRedirection();
|
// app.UseHttpsRedirection();
|
||||||
app.UseCors();
|
app.UseCors();
|
||||||
app.UseDefaultFiles();
|
app.UseDefaultFiles();
|
||||||
app.UseStaticFiles();
|
|
||||||
|
app.UseStaticFiles(new StaticFileOptions
|
||||||
|
{
|
||||||
|
ServeUnknownFileTypes = true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
using (var scope = app.Services.CreateScope())
|
using (var scope = app.Services.CreateScope())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user