- Add sidebar dashboard navigation and support multiple dashboards - Extract catalog grid/form logic to reusable CatalogsGrid component - Add CatalogApiClient and DTOs for catalog CRUD operations - Define dashboards with JSON data sources (Default, CatalogsGrid) - Update configuration for dashboard and API endpoints - Improve styling and imports for modularity and maintainability
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using DbFirst.BlazorWebApp.Components;
|
|
using DbFirst.BlazorWebApp.Services;
|
|
using DevExpress.Blazor;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
builder.Services.AddRazorComponents()
|
|
.AddInteractiveServerComponents();
|
|
|
|
builder.Services.AddDevExpressBlazor();
|
|
|
|
var apiBaseUrl = builder.Configuration["ApiBaseUrl"];
|
|
if (!string.IsNullOrWhiteSpace(apiBaseUrl))
|
|
{
|
|
builder.Services.AddHttpClient<CatalogApiClient>(client =>
|
|
{
|
|
client.BaseAddress = new Uri(apiBaseUrl);
|
|
});
|
|
}
|
|
else
|
|
{
|
|
builder.Services.AddHttpClient<CatalogApiClient>();
|
|
}
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
|
// 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.UseAntiforgery();
|
|
|
|
app.MapRazorComponents<App>()
|
|
.AddInteractiveServerRenderMode();
|
|
|
|
app.Run();
|