adding gitea service
This commit is contained in:
@@ -7,6 +7,9 @@ using Mindforge.API.Services.Interfaces;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Ensure environment variables are loaded into IConfiguration
|
||||
builder.Configuration.AddEnvironmentVariables();
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllers();
|
||||
builder.Logging.AddConsole();
|
||||
@@ -37,6 +40,7 @@ builder.Services.AddScoped<ILlmApiProvider, GeminiApiProvider>();
|
||||
builder.Services.AddScoped<IAgentService, AgentService>();
|
||||
builder.Services.AddScoped<IFileService, FileService>();
|
||||
builder.Services.AddScoped<IFlashcardService, FlashcardService>();
|
||||
builder.Services.AddScoped<IGiteaService, GiteaService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@@ -68,4 +72,17 @@ if (string.IsNullOrEmpty(geminiKey))
|
||||
app.Logger.LogWarning("GEMINI_API_KEY not found in configuration.");
|
||||
}
|
||||
|
||||
var giteaRepoUrl = builder.Configuration["GITEA_REPO_URL"];
|
||||
var giteaAccessToken = builder.Configuration["GITEA_ACCESS_TOKEN"];
|
||||
|
||||
if (string.IsNullOrEmpty(giteaRepoUrl))
|
||||
{
|
||||
app.Logger.LogWarning("GITEA_REPO_URL not found in configuration. Repository features will not work.");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(giteaAccessToken))
|
||||
{
|
||||
app.Logger.LogWarning("GITEA_ACCESS_TOKEN not found in configuration. Repository features will not work.");
|
||||
}
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user