25 lines
568 B
C#
25 lines
568 B
C#
using GetFromLoki.Services;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
builder.Services.AddControllers();
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
// Register Loki service
|
|
builder.Services.AddHttpClient<ILokiService, LokiService>();
|
|
builder.Services.Configure<LokiOptions>(
|
|
builder.Configuration.GetSection("Loki"));
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
|
|
app.UseAuthorization();
|
|
app.MapControllers();
|
|
|
|
app.Run();
|