How to register normal MVC controller when using Umbraco 12

58 views Asked by At

I'm trying to register a normal ASP.NET Core 7 MVC route with Umbraco 12. This controller should be responsible for PayPal payment process and it's not related to Umbraco at all.

I tried to register the controller this way:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
    }

    app.UseUmbraco()
        .WithMiddleware(u =>
        {
            u.UseBackOffice();
            u.UseWebsite();
        })
        .WithEndpoints(u =>
        {
            u.UseInstallerEndpoints();
            u.UseBackOfficeEndpoints();
            u.UseWebsiteEndpoints();
            u.EndpointRouteBuilder.MapControllerRoute(
                "PayPal",
                "paypal/{action}",
                new { controller = "PayPal", action = "Index" });
        });
}

But when I try to access the endpoint, Umbraco returns my "not found" page.

0

There are 0 answers