Ejemplo n.º 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, IDatabaseProvisioner dbProvisioner)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                //app.UseHsts();
            }

            dbProvisioner.AddStepsFromAssemblyResources(typeof(Startup).Assembly);
            dbProvisioner.Provision();

            //app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseMvc(o =>
            {
                o.MapRoute("Default", "{id}", new { controller = "Redir", action = "Index" });
            });
        }
Ejemplo n.º 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, IDatabaseProvisioner dbProvisioner)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            dbProvisioner.AddStepsFromAssemblyResources(typeof(Startup).Assembly);
            if (!dbProvisioner.Provision())
            {
                throw new Exception("Could not open database connection");
            }

#if DEBUG
            app.UseCors(builder => builder.WithOrigins("https://localhost:44379").AllowAnyHeader().AllowAnyMethod());
#endif

            app.UseHttpsRedirection();
            app.UseMvc();
        }