41 lines
976 B
C#
41 lines
976 B
C#
using Microsoft.FluentUI.AspNetCore.Components;
|
|
using Pos.Service;
|
|
using Pos.Web.Components;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.AddServiceDefaults();
|
|
|
|
builder.Services.AddRazorComponents()
|
|
.AddInteractiveServerComponents();
|
|
|
|
builder.Services.AddFluentUIComponents();
|
|
builder.Services.AddScoped<EmployeeService>();
|
|
builder.Services.AddScoped<SaleService>();
|
|
builder.Services.AddScoped<ProductGroupService>();
|
|
builder.Services.AddScoped<ProductService>();
|
|
builder.Services.AddScoped<SalesTransactionService>();
|
|
|
|
var app = builder.Build();
|
|
|
|
app.MapDefaultEndpoints();
|
|
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
|
app.UseHsts();
|
|
}
|
|
|
|
app.UseStatusCodePagesWithReExecute(
|
|
"/not-found",
|
|
createScopeForStatusCodePages: true);
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseAntiforgery();
|
|
|
|
app.MapStaticAssets();
|
|
app.MapRazorComponents<App>()
|
|
.AddInteractiveServerRenderMode();
|
|
|
|
app.Run();
|