public CatalogService(IFlightApi flightApi, AmadeusContext db, ILogger <CatalogService> logger, IConfiguration configuration) { this.flightApi = flightApi; this.db = db; this.logger = logger; this.configuration = configuration; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, AmadeusContext db, ILoggerFactory loggerFactory) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } db.Database.Migrate(); app.UseCors(cfg => cfg.WithOrigins(this.Configuration["Urls.client"]) .AllowAnyOrigin() .AllowCredentials() .AllowAnyHeader() .AllowAnyMethod() ); app.UseMvc(); }