Refactors project structure to support modular, feature-driven development Introduces comprehensive language localization support Adds menu management with role-based access control Implements dynamic sidebar and theme switching capabilities Enhances project scalability and maintainability
29 lines
No EOL
782 B
C#
29 lines
No EOL
782 B
C#
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using CalendarServer.Features.Menu.Services;
|
|
using CalendarServer.Features.Language.Services;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add MVC services
|
|
builder.Services.AddControllersWithViews();
|
|
|
|
// Register application services
|
|
builder.Services.AddScoped<IMenuService, MockMenuService>();
|
|
builder.Services.AddScoped<ILocalizationService, JsonLocalizationService>();
|
|
|
|
var app = builder.Build();
|
|
|
|
// Serve static files from wwwroot
|
|
app.UseStaticFiles();
|
|
|
|
// Configure routing
|
|
app.UseRouting();
|
|
|
|
// Map MVC routes
|
|
app.MapControllerRoute(
|
|
name: "default",
|
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
|
|
|
app.Run("http://localhost:8000"); |