ChatCheap/ChatGemini/Program.cs
2025-05-20 21:51:05 -03:00

31 lines
680 B
C#

using ChatServerSpace.Services;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddHttpClient();
// Register services
builder.Services.AddSingleton<IChatHistoryService, MongoDbChatHistoryService>();
builder.Services.AddScoped<IChatService, ServerSpaceChatService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();