예제 #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)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
                app.UseDatabaseErrorPage();
            }

            app.UseStaticFiles();
            //app.UseStaticFiles(new StaticFileOptions
            //{
            //    OnPrepareResponse = options =>
            //    {
            //        var durationInSeconds = 86400;
            //        options.Context.Response.Headers["Cache-Control"] = "public,max-age=" + durationInSeconds;
            //    }
            //});

            app.UseMvc(routes =>
            {
                //routes.MapRoute(
                //    name: "default",
                //    template: "{controller=Home}/{action=Index}/{id?}");

                routes.MapSpaFallbackRoute(
                    name: "spa-fallback",
                    defaults: new { controller = "Home", action = "Index" });
            });

            // Configure Kendo UI
            app.UseKendo(env);

            if (MigrationHelper.IsActive)
            {
                MigrationHelper.Init(app, SeedData.Apply);
            }

            AutoMapperHelper.Configure();
        }