using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Nop.Core.Infrastructure;
using Nop.Plugin.Misc.SignalRApi.Hubs;
using Nop.Plugin.Misc.SignalRApi.Services;
using Nop.Services.Customers;
using Nop.Services.Localization;
namespace Nop.Plugin.Misc.SignalRApi.Infrastructure
{
public class PluginNopStartup : INopStartup
{
///
/// Add and configure any of the middleware
///
/// Collection of service descriptors
/// Configuration of the application
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
services.Configure(options =>
{
options.ViewLocationExpanders.Add(new ViewLocationExpander());
});
//register services and interfaces
//services.AddScoped();
services.AddSignalR();
services.AddScoped();
services.AddScoped();
services.AddScoped();
services.AddScoped();
}
///
/// Configure the using of added middleware
///
/// Builder for configuring an application's request pipeline
public void Configure(IApplicationBuilder application)
{
//application.UseEndpoints(endpoints =>
//{
// endpoints.MapHub("/mainHub");
//});
//application.UseCors(options => {
// options.AllowAnyMethod().AllowAnyHeader().AllowCredentials().SetIsOriginAllowed((hosts) => true);
//});
}
///
/// Gets order of this startup configuration implementation
///
public int Order => 3000;
}
}