Skip to content

Instantly share code, notes, and snippets.

@rickbutterfield
Last active April 19, 2022 12:24
Show Gist options
  • Save rickbutterfield/429102ade0f5ab1bb758a1c2481d8e0f to your computer and use it in GitHub Desktop.
Save rickbutterfield/429102ade0f5ab1bb758a1c2481d8e0f to your computer and use it in GitHub Desktop.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseUmbraco()
.WithMiddleware(u =>
{
u.UseBackOffice();
u.UseWebsite();
})
.WithEndpoints(u =>
{
u.EndpointRouteBuilder.MapControllerRoute(
"BlogsByYear",
"/blog",
new { Controller = "Blog", Action = "Index" });
u.EndpointRouteBuilder.MapControllerRoute(
"BlogsByYear",
"/blog/{year}",
new { Controller = "Blog", Action = "BlogsByYear" });
u.EndpointRouteBuilder.MapControllerRoute(
"BlogsByYear",
"/blog/{year}/{month}",
new { Controller = "Blog", Action = "BlogsByYearAndMonth" });
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment