Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller}/{action=Index}/{id?}");
                endpoints.MapHub <EventHub>("/events");
                endpoints.MapHealthChecks("/health");
            });

            app.UseStaticFiles();
            app.UseHttpsRedirection();
            app.UseMvc();
            var migrator = app.ApplicationServices.GetService <IStorageSchemeMigrator>();

            migrator.CreateIfNotExists();
            BusConfig.Initialize(app.ApplicationServices.GetService <IBus>());
        }
Ejemplo n.º 2
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.UseHsts();
            }

            app.UseSignalR(routes =>
            {
                routes.MapHub <EventHub>("/events");
            });
            app.UseStaticFiles();
            app.UseHttpsRedirection();
            app.UseMvc();
            var migrator = app.ApplicationServices.GetService <IStorageSchemeMigrator>();

            migrator.CreateIfNotExists();
            BusConfig.Initialize(app.ApplicationServices.GetService <IBus>());
        }