29 lines
782 B
C#
29 lines
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");
|