コード例 #1
0
ファイル: Startup.cs プロジェクト: Salah856/ReadSwap.Server
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticFiles();

            app.ConfigureOpenAPI();

            app.UseRouting();

            app.UseAuthentication();

            app.UseAuthorization();

            // Adding Cors
            app.UseCors(corsPolicy);

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            serviceProvider.ConfigureDataAccess().GetAwaiter().GetResult();
        }