Initial
This commit is contained in:
		
							
								
								
									
										76
									
								
								SearchWebApi/Startup.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								SearchWebApi/Startup.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,76 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.AspNetCore.HttpsPolicy; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using Microsoft.Extensions.Configuration; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Microsoft.Extensions.Hosting; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using Repositories; | ||||
| using Repositories.Interfaces; | ||||
| using BusinessLogic.LookupLogic; | ||||
| using BusinessLogic.LookupLogic.Interfaces; | ||||
| using SearchLogic; | ||||
|  | ||||
| namespace FwSearchApi | ||||
| { | ||||
|     public class Startup | ||||
|     { | ||||
|  | ||||
|         readonly ILogger<Startup> _logger; | ||||
|         public IConfiguration _configuration { get; } | ||||
|  | ||||
|         public Startup(IConfiguration configuration, ILogger<Startup> logger) | ||||
|         { | ||||
|             _configuration = configuration; | ||||
|             _logger = logger; | ||||
|             _logger.LogInformation("Starting up FeatureWerk Search API"); | ||||
|         } | ||||
|  | ||||
|         // This method gets called by the runtime. Use this method to add services to the container. | ||||
|         public void ConfigureServices(IServiceCollection services) | ||||
|         { | ||||
|             services.AddControllers().AddNewtonsoftJson((options) =>  | ||||
|             { | ||||
|                 // keine Optionen hier  | ||||
|             }); | ||||
|  | ||||
|             services.AddTransient<ILookupLogic, FwLookupLogic>(); | ||||
|             services.AddTransient<IFwMariaLookupRepo, FwMariaLookupRepo>(); | ||||
|             services.AddTransient<IFwMariaSearchRepo, FwMariaSearchRepo>(); | ||||
|             services.AddTransient<ISearchLogic, SearchLogic.SearchLogic>(); | ||||
|             services.AddSwaggerGen(); | ||||
|  | ||||
|             _logger.LogInformation("Services for FeatureWerkAPIs configured"); | ||||
|         } | ||||
|  | ||||
|         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | ||||
|         public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | ||||
|         { | ||||
|             if (env.IsDevelopment()) | ||||
|             { | ||||
|                 app.UseDeveloperExceptionPage(); | ||||
|             } | ||||
|  | ||||
|             app.UseSwagger(); | ||||
|  | ||||
|             app.UseSwaggerUI(c => | ||||
|             { | ||||
|                 c.SwaggerEndpoint("/swagger/v1/swagger.json", "FeatureWerk Search API V1"); | ||||
|             }); | ||||
|  | ||||
|             app.UseHttpsRedirection(); | ||||
|  | ||||
|             app.UseRouting(); | ||||
|  | ||||
|             app.UseEndpoints(endpoints => | ||||
|             { | ||||
|                 endpoints.MapControllers(); | ||||
|             }); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user