This commit is contained in:
@@ -49,22 +49,25 @@ 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;
|
||||
// };
|
||||
// //options.ShouldProfile = request => false;
|
||||
// }).AddEntityFramework();
|
||||
_newLog.LogDebug("Health");
|
||||
services.AddHealthChecks().AddDbContextCheck<AyContext>();;
|
||||
|
||||
_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("/license").IgnorePath("/user").IgnorePath("/docs");
|
||||
options.ResultsAuthorize = request =>
|
||||
{
|
||||
if (request.HttpContext.Items["AY_PROFILER_ALLOWED"] != null)
|
||||
return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
}).AddEntityFramework();
|
||||
|
||||
|
||||
//Server state service for shutting people out of api
|
||||
@@ -474,13 +477,14 @@ namespace AyaNova
|
||||
|
||||
|
||||
_newLog.LogDebug("Profiler");
|
||||
// app.UseMiniProfiler();
|
||||
app.UseMiniProfiler();
|
||||
|
||||
|
||||
|
||||
_newLog.LogDebug("Endpoints pipeline");
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapHealthChecks("/health");
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user