WIP
This commit is contained in:
parent
54b057886c
commit
7fc1ae0650
204 changed files with 4345 additions and 134 deletions
47
PlanTempus.Application/Program.cs
Normal file
47
PlanTempus.Application/Program.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc.Razor;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using PlanTempus.Application.Features.Localization.Services;
|
||||
using PlanTempus.Application.Features.Menu.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add Razor Pages with feature-based structure
|
||||
builder.Services.AddRazorPages(options =>
|
||||
{
|
||||
options.RootDirectory = "/Features";
|
||||
})
|
||||
.AddRazorOptions(options =>
|
||||
{
|
||||
// View locations for partials and ViewComponents
|
||||
options.ViewLocationFormats.Add("/Features/_Shared/Pages/{0}.cshtml");
|
||||
options.ViewLocationFormats.Add("/Features/_Shared/Components/{1}/{0}.cshtml");
|
||||
|
||||
});
|
||||
|
||||
// Register application services
|
||||
builder.Services.AddScoped<IMenuService, MockMenuService>();
|
||||
builder.Services.AddScoped<ILocalizationService, JsonLocalizationService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Developer exception page for debugging
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
// Serve static files from wwwroot
|
||||
app.UseStaticFiles();
|
||||
|
||||
// Configure routing
|
||||
app.UseRouting();
|
||||
|
||||
// Map Razor Pages
|
||||
app.MapRazorPages();
|
||||
|
||||
app.Run("http://localhost:8000");
|
||||
|
||||
// Note: Set ASPNETCORE_ENVIRONMENT=Development for detailed error pages
|
||||
Loading…
Add table
Add a link
Reference in a new issue