コード例 #1
0
ファイル: Startup.cs プロジェクト: Daviazuos/WebDebts
        public void ConfigureServices(IServiceCollection services)
        {
            ApplicationStartup.RegisterServices(services, Configuration);

            services.AddCors(o => o.AddPolicy("cors", builder =>
            {
                builder.AllowAnyOrigin()
                .AllowAnyMethod()
                .AllowAnyHeader();
            }));

            services.AddMvc().AddJsonOptions(o =>
            {
                o.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
            });

            services.AddControllers();
            services.AddSwaggerGen();
        }