diff --git a/Program.cs b/Program.cs index 009f755..3c494d1 100644 --- a/Program.cs +++ b/Program.cs @@ -1,24 +1,32 @@ using GetFromLoki.Services; -var builder = WebApplication.CreateBuilder(args); +namespace GetFromLoki; -// Add services to the container. -builder.Services.AddControllers(); -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); +public class Program +{ + public static void Main(string[] args) + { + var builder = WebApplication.CreateBuilder(args); -// Register Loki service -builder.Services.AddHttpClient(); -builder.Services.Configure( - builder.Configuration.GetSection("Loki")); + // Add services to the container. + builder.Services.AddControllers(); + builder.Services.AddEndpointsApiExplorer(); + builder.Services.AddSwaggerGen(); -var app = builder.Build(); + // Register Loki service + builder.Services.AddHttpClient(); + builder.Services.Configure( + builder.Configuration.GetSection("Loki")); -// Configure the HTTP request pipeline. -app.UseSwagger(); -app.UseSwaggerUI(); + var app = builder.Build(); -app.UseAuthorization(); -app.MapControllers(); + // Configure the HTTP request pipeline. + app.UseSwagger(); + app.UseSwaggerUI(); -app.Run(); + app.UseAuthorization(); + app.MapControllers(); + + app.Run(); + } +} diff --git a/README.md b/README.md index 9cfaa15..bfdc5b4 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## Требования -- .NET 8.0 +- .NET 6.0 - Grafana Loki (работающий на http://localhost:3100) ## Запуск @@ -119,4 +119,4 @@ curl -X POST "http://localhost:5000/api/logs/query" \ ## Swagger UI После запуска сервиса документация API доступна по адресу: -http://localhost:5000/swagger +http://localhost:5000/swagger/index.html diff --git a/global.json b/global.json new file mode 100644 index 0000000..5087a86 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "6.0.0", + "rollForward": "latestMajor" + } +}