Implemented indexer, cleanup

This commit is contained in:
EzFeDezy
2025-05-26 15:53:18 +02:00
parent 85141c879f
commit f6a4a75e4f
22 changed files with 791 additions and 50 deletions

31
src/Indexer/Program.cs Normal file
View File

@@ -0,0 +1,31 @@
using Indexer.Models;
using Indexer.Services;
using server;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSingleton<Client.Client>();
builder.Services.AddSingleton<WorkerCollection>();
builder.Services.AddHostedService<IndexerService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
else
{
app.UseMiddleware<ApiKeyMiddleware>();
}
// app.UseHttpsRedirection();
app.Run();