init
This commit is contained in:
24
Program.cs
Normal file
24
Program.cs
Normal file
@ -0,0 +1,24 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user