Exemplo n.º 1
0
        public void Configuration(IAppBuilder app)
        {
            //Configure the hub with dependency injection. (Use IOC container, not like this..)
            GlobalHost.DependencyResolver.Register(
                typeof(DemoHub),
                () => new DemoHub(new DemoHubProxy(new ResonanceHubMemoryRepository <DemoServiceInformation>())));

            GlobalHost.DependencyResolver.Register(typeof(LoggingHub), () => new LoggingHub());

            app.UseCors(CorsOptions.AllowAll);
            app.MapSignalR(new HubConfiguration()
            {
                EnableDetailedErrors = true //Include exception messages from hub!
            });

            GlobalHost.Configuration.MaxIncomingWebSocketMessageSize = null;       //Unlimited message size.
            GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromSeconds(10); //Optional, configure the reconnection timeout (minimum 6 seconds).

            LoggingConfiguration.ConfigureLogging();

            LoggingConfiguration.LogReceived += (x, e) =>
            {
                LoggingHub.PublishLog(e);
            };
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            var configuration = GetConfiguration();

            LoggingConfiguration.ConfigureLogging(configuration);

            CreateHost(args);
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            IConfiguration configuration = GetConfiguration();

            LoggingConfiguration.ConfigureLogging(configuration);

            Log.Information("DBMigration.Service has been initialized.");

            new GraphDataMigrator(configuration).Migrate();
        }
Exemplo n.º 4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            LoggingConfiguration.ConfigureLogging(app, env, loggerFactory, Configuration);
            app.UseAuthentication();
            SwaggerConfiguration.AddSwagger(app);
            CorsConfiguration.UseCors(app);
            if (!env.IsDevelopment())
            {
                var context = app.ApplicationServices.GetService <PgsKanbanContext>();
                context.Database.Migrate();
            }

            SignalRConfiguration.UseSignalR(app);
            app.UseMvc();
        }
Exemplo n.º 5
0
        // This code configures Web API. The Startup class is specified as a type
        // parameter in the WebApp.Start method.
        public void Configuration(IAppBuilder appBuilder)
        {
            // Configure Web API for self-host.
            HttpConfiguration config = new HttpConfiguration();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );

            appBuilder.UseWebApi(config);

            var fileSystem = new PhysicalFileSystem(".");
            var options    = new FileServerOptions
            {
                EnableDefaultFiles = true,
                FileSystem         = fileSystem
            };

            appBuilder.UseFileServer(options);

            //Configure the hub with dependency injection. (Use IOC container, not like this..)
            GlobalHost.DependencyResolver.Register(
                typeof(DemoHub),
                () => new DemoHub(new DemoHubProxy(new ResonanceHubMemoryRepository <DemoServiceInformation>())));

            GlobalHost.DependencyResolver.Register(typeof(LoggingHub), () => new LoggingHub());

            appBuilder.UseCors(CorsOptions.AllowAll);
            appBuilder.MapSignalR(new HubConfiguration()
            {
                EnableDetailedErrors = true //Include exception messages from hub!
            });

            GlobalHost.Configuration.MaxIncomingWebSocketMessageSize = null; //Unlimited message size.

            LoggingConfiguration.ConfigureLogging();

            LoggingConfiguration.LogReceived += (x, e) =>
            {
                LoggingHub.PublishLog(e);
            };
        }
Exemplo n.º 6
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     LoggingConfiguration.ConfigureLogging();
 }
Exemplo n.º 7
0
 protected override void OnStart()
 {
     LoggingConfiguration.ConfigureLogging();
 }