コード例 #1
0
        public void Configuration(IAppBuilder app)
        {
            app.UseCors(CorsOptions.AllowAll);
            ConfigureAuth(app);
            app.Map("/signalr", map =>
            {
                //CorsPolicyProvider provider = new EnableCorsAttribute("*", "*", "*");
                CorsOptions options = CorsOptions.AllowAll;
                //options.PolicyProvider =
                map.UseCors(options);

                map.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions
                {
                    Provider = new OAuthTokenProvider()
                });

                var hubConfiguration = new HubConfiguration
                {
                    Resolver = GlobalHost.DependencyResolver
                };
                map.RunSignalR(hubConfiguration);
            });

            string name = ConfigurationManager.AppSettings["LoggingDefaults"];

            SeriLogHelper.ConfigureLoggingDefaults(name);
            CacheConfig.Register();
        }
コード例 #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            System.Web.Http.GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            string name = ConfigurationManager.AppSettings["LoggingDefaults"];

            SeriLogHelper.ConfigureLoggingDefaults(name);
            System.Web.Http.GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = System.Web.Http.IncludeErrorDetailPolicy.Always;
            System.Web.Http.GlobalConfiguration.Configuration.Services.Add(typeof(IExceptionLogger), new CustomExceptionHandler());
            //Hangfire.GlobalConfiguration.Configuration.UseSqlServerStorage("DefaultSchedulerConnection").UseDashboardMetric(SqlServerStorage.ActiveConnections);

            //SampleScheduler.Start();
        }
コード例 #3
0
ファイル: Startup.cs プロジェクト: tomatoe45/bizbook-server
        public void Configuration(IAppBuilder app)
        {
            app.UseCors(CorsOptions.AllowAll);
            //ConfigureAuth(app);
            app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions
            {
                Provider = new OAuthTokenProvider()
            });


            app.MapSignalR();
            string name = ConfigurationManager.AppSettings["LoggingDefaults"];

            SeriLogHelper.ConfigureLoggingDefaults(name);
            //GlobalConfiguration.Configuration.UseSqlServerStorage("DefaultSchedulerConnection");
            //app.UseHangfireDashboard();
            //app.UseHangfireServer();
        }