5100* tests strengthtenen work
This commit is contained in:
@@ -4,6 +4,7 @@ using StellaOps.RiskEngine.Core.Contracts;
|
||||
using StellaOps.RiskEngine.Core.Providers;
|
||||
using StellaOps.RiskEngine.Core.Services;
|
||||
using StellaOps.RiskEngine.Infrastructure.Stores;
|
||||
using StellaOps.Router.AspNet;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -20,6 +21,13 @@ builder.Services.AddSingleton<IRiskScoreProviderRegistry>(_ =>
|
||||
new FixExposureProvider()
|
||||
}));
|
||||
|
||||
// Stella Router integration
|
||||
var routerOptions = builder.Configuration.GetSection("RiskEngine:Router").Get<StellaRouterOptionsBase>();
|
||||
builder.Services.TryAddStellaRouter(
|
||||
serviceName: "riskengine",
|
||||
version: typeof(Program).Assembly.GetName().Version?.ToString() ?? "1.0.0",
|
||||
routerOptions: routerOptions);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
@@ -28,6 +36,7 @@ if (app.Environment.IsDevelopment())
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.TryUseStellaRouter(routerOptions);
|
||||
|
||||
app.MapGet("/risk-scores/providers", (IRiskScoreProviderRegistry registry) =>
|
||||
Results.Ok(new { providers = registry.ProviderNames.OrderBy(n => n, StringComparer.OrdinalIgnoreCase) }));
|
||||
@@ -89,6 +98,9 @@ app.MapPost("/risk-scores/simulations/summary", async (
|
||||
return Results.Ok(new { summary, results });
|
||||
});
|
||||
|
||||
// Refresh Router endpoint cache
|
||||
app.TryRefreshStellaRouterEndpoints(routerOptions);
|
||||
|
||||
app.Run();
|
||||
|
||||
static async Task<List<RiskScoreResult>> EvaluateAsync(
|
||||
|
||||
Reference in New Issue
Block a user