using JSMR.Api.Startup;

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

ConfigurationManager configuration = builder.Configuration;
IWebHostEnvironment environment = builder.Environment;

builder.Services
    .AddAppServices(configuration)
    .AddAppJson()
    .AddAppOpenApi()
    .AddAppAuthentication(environment)
    .AddAppCors(configuration);
    //.AddAppLogging(builder);

builder.Host.UseAppSerilog();

WebApplication app = builder.Build();
app.UseAppPipeline(app.Environment);

if (app.Environment.IsDevelopment())
    await app.SeedDevelopmentAsync();

app.MapAppEndpoints();

app.Run();