54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
using Blazorise;
|
|
using Blazorise.Bootstrap;
|
|
using Blazorise.Icons.FontAwesome;
|
|
using Gremlin_BlazorServer.Data.DBClasses;
|
|
using Gremlin_BlazorServer.Data.EntityClasses;
|
|
using Gremlin_BlazorServer.Services;
|
|
|
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
builder.Services.AddRazorPages();
|
|
builder.Services.AddServerSideBlazor();
|
|
|
|
builder.Services.AddScoped<GremlinDb>();
|
|
builder.Services.AddScoped<ControllerService<Contact>>();
|
|
builder.Services.AddScoped<ControllerService<Account>>();
|
|
builder.Services.AddScoped<ControllerService<AccountType>>();
|
|
builder.Services.AddScoped<ControllerService<ProductLine>>();
|
|
builder.Services.AddScoped<ControllerService<Product>>();
|
|
|
|
builder.Services.AddScoped<CustomDescriptionService>();
|
|
builder.Services.AddScoped<LineItemService>();
|
|
builder.Services.AddScoped<QuoteService>();
|
|
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(); |