Пример #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              ILoggerFactory loggerFactory, CarDbInitializer initializerDb)
        {
            loggerFactory.AddConsole(_cfg.GetSection("Logging"));
            loggerFactory.AddDebug();
            app.UseCors(cfg => {
                cfg.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin();
            });
            app.UseIdentity();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            ///use this for my photos
            app.UseStaticFiles();

            app.UseMvc();
            initializerDb.Seed().Wait();
        }
Пример #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, CarDbContext carContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();
            app.UseCors("AllowAllHeaders");
            CarDbInitializer.Initialize(carContext);
        }