public void ConfigureServices(IServiceCollection services) { services = ConfigureJwt.Configure(services, Configuration); services.AddCors(cors => { cors.AddPolicy("CorsPolicy", builder => builder.WithOrigins(Configuration["ClientApp"]) .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials()); }); services.AddOcelot() .AddCacheManager(settings => settings.WithDictionaryHandle()); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddMvc(); services.AddServices(Configuration); services = ConfigureJwt.Configure(services, Configuration); services.AddSwaggerGen(swagger => { swagger.DescribeAllParametersInCamelCase(); swagger.SwaggerDoc("v1", new OpenApiInfo { Title = "WorkerCompany API" }); }); services.AddSwaggerGenNewtonsoftSupport(); }
public static IServiceCollection AddAuthenticationService(this IServiceCollection services, IConfiguration configuration) { services = ConfigureJwt.Configure(services, configuration); return(services); }