Beispiel #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();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

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

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

            HighlightDatabase.Initialize();
        }
Beispiel #2
0
        protected void Application_Start()
        {
            //Thread.Sleep(10000);

            ViewEngines.Engines.Clear();
            var viewEngine = new CustomViewEngine();

            ViewEngines.Engines.Add(viewEngine);

            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var v8Ef = new V8JsEngineFactory();

            JsEngineSwitcher.Instance.EngineFactories.Add(v8Ef);
            JsEngineSwitcher.Instance.DefaultEngineName = v8Ef.EngineName;

            HighlightDatabase.Initialize();
            log4net.Config.XmlConfigurator.Configure();
        }