Moved middleware configuration to separated file
This commit is contained in:
		| @@ -9,15 +9,7 @@ public class Program | ||||
|         builder.Services.RegisterServices(); | ||||
|  | ||||
|         var app = builder.Build(); | ||||
|             app.UseSwagger(); | ||||
|             app.UseSwaggerUI(); | ||||
|  | ||||
|         app.UseHttpsRedirection(); | ||||
|  | ||||
|         app.UseAuthorization(); | ||||
|  | ||||
|  | ||||
|         app.MapControllers(); | ||||
|         app.ConfigurePipelineRequest(); | ||||
|  | ||||
|         app.Run(); | ||||
|     } | ||||
|   | ||||
							
								
								
									
										19
									
								
								SchengenVisaApi/SchengenVisaApi/RequestPipeline.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								SchengenVisaApi/SchengenVisaApi/RequestPipeline.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| namespace SchengenVisaApi | ||||
| { | ||||
|     /// Provides methods for configuring middleware | ||||
|     public static class PipelineRequest | ||||
|     { | ||||
|         /// Configure general middleware | ||||
|         public static WebApplication ConfigurePipelineRequest(this WebApplication app) | ||||
|         { | ||||
|             app.UseSwagger() | ||||
|                 .UseSwaggerUI(); | ||||
|  | ||||
|             app.UseHttpsRedirection(); | ||||
|  | ||||
|             app.MapControllers(); | ||||
|  | ||||
|             return app; | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user