// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, StoreContextSeed seeder, UserManager <AppUser> userManager) { seeder.Seed(); app.UseMiddleware <ExceptionMiddleware>(); if (env.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "API v1")); } app.UseStatusCodePagesWithReExecute("/errors/{0}"); app.UseHttpsRedirection(); app.UseRouting(); app.UseStaticFiles(); app.UseCors(CorsPolicyName); app.UseAuthentication(); IdentitySeeder.SeedData(userManager); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }