Esempio n. 1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.UseDeveloperExceptionPage();
            app.UseSession(); //This must come before UseMvc. Else, you'll get InvalidOperationException
            app.UseIdentity();
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "areaRoute",
                    template: "{area:exists}/{controller=Books}/{action=Index}"
                    //defaults: new { action = "Index" });
                    );

                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action}/{id?}",
                    defaults: new { controller = "library", action = "Index" }
                    );
            });

            //Thanks: Scott Allen for this middleware
            app.UseNodeModules(env);
            DatabaseSeeder.SeedTheDatabase(app.ApplicationServices).Wait();
            app.UseStaticFiles();
        }