using Blazorise;
using Blazorise.Bootstrap;
using Blazorise.Icons.FontAwesome;
using Gremlin_BlazorServer.Data.DBClasses;
using Gremlin_BlazorServer.Services;

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();

builder.Services.AddScoped<GremlinContext>();
builder.Services.AddScoped<AccountService>();
builder.Services.AddScoped<ContactService>();
builder.Services.AddScoped<CustomDescriptionService>();
builder.Services.AddScoped<LineItemService>();
builder.Services.AddScoped<QuoteService>();
builder.Services.AddScoped<ProductService>();
builder.Services.AddScoped<ProductLineService>();
builder.Services.AddScoped<AccountTypeService>();
builder.Services.AddScoped<LoginService>();
builder.Services.AddScoped<ClipboardService>();

builder.Services.AddBlazorise(options => { options.Immediate = true; }).AddBootstrapProviders().AddFontAwesomeIcons();
builder.Services.AddOptions();
builder.Services.AddAuthorizationCore();

builder.WebHost.UseWebRoot("wwwroot");
builder.WebHost.UseStaticWebAssets();

builder.WebHost.UseUrls("https://*:5000");

WebApplication app = builder.Build();

// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
	_ = app.UseExceptionHandler("/Error");
	// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
	_ = app.UseHsts();
}
app.UseHttpsRedirection();

app.UseStaticFiles();

app.UseRouting();

app.MapBlazorHub();
app.MapFallbackToPage("/_Host");

app.Run();