Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        // 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();
        }
Ejemplo n.º 3
0
        public static IServiceCollection AddAuthenticationService(this IServiceCollection services, IConfiguration configuration)
        {
            services = ConfigureJwt.Configure(services, configuration);

            return(services);
        }