When you add Piranha to your Startup.cs
as described in Application Setup, all of the available middleware and routing components are added by default. While this perfect for most green field websites you may need to control the exactly what parts of the pipeline that are active when integrating Piranha into an existing application.
services.AddPiranha(options =>
{
options.AddRazorRuntimeCompilation = true;
});
Enables runtime compilation for Razor .cshtml
files. This is useful for development environments so that you don't have to restart the application every time you update a view or page. The default value of this property is false as you shouldn't have runtime compilation enabled in production.
services.AddPiranha(options =>
{
options.UseAliasRouting = false;
});
If alias routing should be enabled in the middleware pipeline. The default value is true.
services.AddPiranha(options =>
{
options.UseArchiveRouting = false;
});
If archive routing should be enabled in the middleware pipeline. The default value is true.
services.AddPiranha(options =>
{
options.UsePageRouting = false;
});
If page routing should be enabled in the middleware pipeline. The default value is true.
services.AddPiranha(options =>
{
options.UsePostRouting = false;
});
If post routing should be enabled in the middleware pipeline. The default value is true.
services.AddPiranha(options =>
{
options.UseSitemapRouting = false;
});
If the middleware should listen for and handle incoming requests to /sitemap.xml
. The default value is true.
services.AddPiranha(options =>
{
options.UseSiteRouting = false;
});
If site routing should be enabled in the middleware pipeline. This can be disabled if you only have one site in your application. The default value is true.
services.AddPiranha(options =>
{
options.UseStartpageRouting = false;
});
If start page routing should be enabled in the middleware pipeline. The default value is true.