new flashcards
All checks were successful
Mindforge API Build and Deploy / Build Mindforge API Image (push) Successful in 4m4s
Mindforge Web Build and Deploy (internal) / Build Mindforge Web Image (push) Successful in 5m29s
Mindforge Web Build and Deploy (internal) / Deploy Mindforge Web (internal) (push) Successful in 9s
Mindforge API Build and Deploy / Deploy Mindforge API (internal) (push) Successful in 8s
All checks were successful
Mindforge API Build and Deploy / Build Mindforge API Image (push) Successful in 4m4s
Mindforge Web Build and Deploy (internal) / Build Mindforge Web Image (push) Successful in 5m29s
Mindforge Web Build and Deploy (internal) / Deploy Mindforge Web (internal) (push) Successful in 9s
Mindforge API Build and Deploy / Deploy Mindforge API (internal) (push) Successful in 8s
This commit is contained in:
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Mindforge.API.Providers;
|
||||
using Mindforge.API.Repositories;
|
||||
using Mindforge.API.Services;
|
||||
using Mindforge.API.Services.Interfaces;
|
||||
|
||||
@@ -39,10 +40,25 @@ builder.Services.AddScoped<ILlmApiProvider, OpenAIApiProvider>();
|
||||
builder.Services.AddScoped<IAgentService, AgentService>();
|
||||
builder.Services.AddScoped<IFileService, FileService>();
|
||||
builder.Services.AddScoped<IFlashcardService, FlashcardService>();
|
||||
builder.Services.AddScoped<IFlashcardRepository, FlashcardRepository>();
|
||||
builder.Services.AddScoped<IGiteaService, GiteaService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
try
|
||||
{
|
||||
var flashcardRepository = scope.ServiceProvider.GetRequiredService<IFlashcardRepository>();
|
||||
await flashcardRepository.EnsureSchemaAsync();
|
||||
app.Logger.LogInformation("Flashcard schema checked successfully.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
app.Logger.LogError(ex, "Could not initialize flashcard schema on startup.");
|
||||
}
|
||||
}
|
||||
|
||||
app.UseCors("AllowAll");
|
||||
|
||||
app.UseMiddleware<Mindforge.API.Middlewares.ExceptionHandlingMiddleware>();
|
||||
@@ -80,4 +96,7 @@ if (string.IsNullOrEmpty(giteaRepoUrl))
|
||||
if (string.IsNullOrEmpty(giteaAccessToken))
|
||||
app.Logger.LogWarning("GITEA_ACCESS_TOKEN not found in configuration. Repository features will not work.");
|
||||
|
||||
if (string.IsNullOrEmpty(builder.Configuration.GetConnectionString("MindforgeDb")))
|
||||
app.Logger.LogWarning("MindforgeDb connection string not found. Falling back to default PostgreSQL connection.");
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user