Files
2026-07-21 15:36:49 +07:00

24 lines
647 B
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ASPNET.FrontEnd;
public static class FrontEndConfiguration
{
public static IServiceCollection AddFrontEndServices(this IServiceCollection services)
{
services.AddRazorPages(options =>
{
options.RootDirectory = "/FrontEnd/Pages";
options.Conventions.ConfigureFilter(new PageAuthorizationFilter());
});
return services;
}
public static IEndpointRouteBuilder MapFrontEndRoutes(this IEndpointRouteBuilder endpoints)
{
endpoints.MapRazorPages()
.WithStaticAssets();
return endpoints;
}
}