public void Configuration(IAppBuilder app) { InitialzieContainer(); InitializeEFConfiguration(); var env = GlobalContainer.GetService <IApplicationEnvironment>(); if (env.IsProduction()) { GlobalContainer.AddSingleton(typeof(ISuitablePathResolver), typeof(MinimizedPathResolver)); } if (!IsWindowsAuthentication()) { Authentication.ConfigureAuth(app); } UseRedirectWhenDirectAccess(app); app.UseCors(CorsOptions.AllowAll); app.UseServiceUnit( ServiceUnitSettings.Create().SetContextCreatedHandler(OnServiceUnitContextCreated), new ServiceUnitApi(), new ServiceUnitForm(), new ServiceUnitResource() { JavaScriptFormatter = (text, culture, resourceName) => { return(";(function(){ App.culture(\"" + culture.Name + "\",{ \"text\": { " + resourceName + ":" + text + "}} );})();"); } }); UseDefaultPage(app); }