コード例 #1
0
ファイル: Startup.cs プロジェクト: Ethriel/WorkerCompanyPet
        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());
        }
コード例 #2
0
ファイル: Startup.cs プロジェクト: Ethriel/WorkerCompanyPet
        // 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();
        }
コード例 #3
0
        public static IServiceCollection AddAuthenticationService(this IServiceCollection services, IConfiguration configuration)
        {
            services = ConfigureJwt.Configure(services, configuration);

            return(services);
        }