James!!
James!!
Explore posts from servers
CC#
Created by James!! on 1/8/2025 in #help
im not getting any response on these endpoints
var builder = WebApplication.CreateBuilder(args);

// Add services to the container
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowAll",
builder => builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader());
});

// Register services
builder.Services.AddHttpClient("OpenAI", client =>
{
client.BaseAddress = new Uri("https://api.openai.com/v1/");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {builder.Configuration["OpenAI:ApiKey"]}");
});
builder.Services.AddScoped<PdfService>();
builder.Services.AddScoped<ContractAnalysisService>();
builder.Services.AddScoped<DatabaseService>();

var app = builder.Build();

// Initialize database
using (var scope = app.Services.CreateScope())
{
var dbService = scope.ServiceProvider.GetRequiredService<DatabaseService>();
dbService.InitializeDatabase();
}

// Configure the HTTP request pipeline
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}

app.UseCors("AllowAll");
app.UseHttpsRedirection();
var builder = WebApplication.CreateBuilder(args);

// Add services to the container
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowAll",
builder => builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader());
});

// Register services
builder.Services.AddHttpClient("OpenAI", client =>
{
client.BaseAddress = new Uri("https://api.openai.com/v1/");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {builder.Configuration["OpenAI:ApiKey"]}");
});
builder.Services.AddScoped<PdfService>();
builder.Services.AddScoped<ContractAnalysisService>();
builder.Services.AddScoped<DatabaseService>();

var app = builder.Build();

// Initialize database
using (var scope = app.Services.CreateScope())
{
var dbService = scope.ServiceProvider.GetRequiredService<DatabaseService>();
dbService.InitializeDatabase();
}

// Configure the HTTP request pipeline
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}

app.UseCors("AllowAll");
app.UseHttpsRedirection();
22 replies
XXata
Created by James!! on 7/16/2024 in #help
Xata pull issue
No description
10 replies