using Autofac.Extensions.DependencyInjection;
using Autofac;
using OpenAuth.WebApi;
using Yitter.IdGenerator;

var builder = WebApplication.CreateBuilder(args);

var startup = new Startup(builder.Configuration);
startup.ConfigureServices(builder.Services);
builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
builder.Host.ConfigureContainer<ContainerBuilder>(startup.ConfigureContainer);
//builder.Configuration.AddJsonFile("appsettings.json", false, true);
var app = builder.Build();
startup.Configure(app, app.Environment);
//var url = app.Configuration.GetValue<string>("AppSetting:HttpHost");
//app.Urls.Add(url);

//var options = new IdGeneratorOptions(1);
//YitIdHelper.SetIdGenerator(options);

app.Run();
