change StaticFilesServer to use Controller

This commit is contained in:
rootdarkarchon
2022-12-19 16:01:25 +01:00
parent 90ccfe4162
commit 827acf0282
3 changed files with 43 additions and 10 deletions

View File

@@ -36,7 +36,7 @@ public class Startup
var mareSettings = Configuration.GetRequiredSection("MareSynchronos");
//services.AddControllers();
services.AddControllers();
var defaultMethodConfig = new MethodConfig
{
@@ -99,18 +99,10 @@ public class Startup
app.UseAuthentication();
app.UseAuthorization();
app.UseStaticFiles(new StaticFileOptions()
{
FileProvider = new PhysicalFileProvider(Configuration.GetRequiredSection("MareSynchronos")["CacheDirectory"]),
RequestPath = "/cache",
ServeUnknownFileTypes = true,
});
app.UseEndpoints(e =>
{
e.MapGrpcService<FileService>();
//e.MapControllers();
e.MapControllers();
});
}
}