This commit is contained in:
2020-06-04 19:24:49 +00:00
parent 5adf4aabcf
commit e68d1c48d2
5 changed files with 54 additions and 19 deletions

View File

@@ -49,21 +49,22 @@ namespace AyaNova
{
_newLog.LogDebug("Initializing services...");
_newLog.LogDebug("Profiler");
//https://dotnetthoughts.net/using-miniprofiler-in-aspnetcore-webapi/
services.AddMemoryCache();
services.AddMiniProfiler(options =>
{
options.RouteBasePath = "/profiler";
//in testing only ignorepaths was reliable and worked and docs say it prevents any profiling at all
options.IgnorePath("/auth").IgnorePath("/user").IgnorePath("/docs");
options.ResultsAuthorize = request =>
{
if (request.HttpContext.Items["AY_PROFILER_ALLOWED"] != null)
return true;
return false;
};
}).AddEntityFramework();
// _newLog.LogDebug("Profiler");
// //https://dotnetthoughts.net/using-miniprofiler-in-aspnetcore-webapi/
// services.AddMemoryCache();
// services.AddMiniProfiler(options =>
// {
// options.RouteBasePath = "/profiler";
// //in testing only ignorepaths was reliable and worked and docs say it prevents any profiling at all
// options.IgnorePath("/auth").IgnorePath("/user").IgnorePath("/docs");
// options.ResultsAuthorize = request =>
// {
// if (request.HttpContext.Items["AY_PROFILER_ALLOWED"] != null)
// return true;
// return false;
// };
// //options.ShouldProfile = request => false;
// }).AddEntityFramework();
//Server state service for shutting people out of api
@@ -473,7 +474,7 @@ namespace AyaNova
_newLog.LogDebug("Profiler");
app.UseMiniProfiler();
// app.UseMiniProfiler();