Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

NopWebMarkupMinStartup.cs

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Nop.Core.Infrastructure;
using Nop.Web.Framework.Infrastructure.Extensions;

namespace Nop.Web.Framework.Infrastructure;

/// 
/// Represents object for the configuring WebMarkupMin services on application startup
/// 
public partial class NopWebMarkupMinStartup : INopStartup
{
    /// 
    /// Add and configure any of the middleware
    /// 
    /// Collection of service descriptors
    /// Configuration of the application
    public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
    {
        //add WebMarkupMin services to the services container
        services.AddNopWebMarkupMin();
    }

    /// 
    /// Configure the using of added middleware
    /// 
    /// Builder for configuring an application's request pipeline
    public void Configure(IApplicationBuilder application)
    {
        //use WebMarkupMin
        application.UseNopWebMarkupMin();
    }

    /// 
    /// Gets order of this startup configuration implementation
    /// 
    public int Order => 300; //Ensure that "UseNopWebMarkupMin" method is invoked before "UseRouting". Otherwise, HTML minification won't work
}