Пример #1
0
        public void Configure(IApplicationBuilder app, IServiceProvider prov,
                              IWebHostEnvironment env,
                              ILoggerFactory loggerFactory, IServiceProvider serviceProvider,
                              CookieRepository cookieRepository)
        {
            cookieRepository.Initialize();
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            Logs.Configure(loggerFactory);

#if !NETCOREAPP21
            app.UseRouting();
#endif
            app.UseAuthentication();
#if !NETCOREAPP21
            app.UseAuthorization();
#endif
            app.UseWebSockets();
            // app.UseMiddleware<LogAllRequestsMiddleware>();
#if NETCOREAPP21
            app.UseMvc();
#else
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
#endif
        }
Пример #2
0
        public void Configure(IApplicationBuilder app, IServiceProvider prov,
                              IWebHostEnvironment env,
                              ILoggerFactory loggerFactory, IServiceProvider serviceProvider,
                              CookieRepository cookieRepository)
        {
            cookieRepository.Initialize();
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            Logs.Configure(loggerFactory);

#if !NETCOREAPP21
            app.UseRouting();
#endif
            app.UseAuthentication();
#if !NETCOREAPP21
            app.UseAuthorization();
#endif
            app.UseWebSockets();
            //app.UseMiddleware<LogAllRequestsMiddleware>();
#if NETCOREAPP21
            app.UseMvc();
#else
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapHealthChecks("health", new Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions()
                {
                    ResponseWriter = HealthChecks.HealthCheckWriters.WriteJSON
                });
                endpoints.MapControllers();
            });
#endif
        }
Пример #3
0
        public void Configure(IApplicationBuilder app, IServiceProvider prov, IHostingEnvironment env, ILoggerFactory loggerFactory, IServiceProvider serviceProvider,
                              CookieRepository cookieRepository)
        {
            cookieRepository.Initialize();
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            Logs.Configure(loggerFactory);
            app.UseAuthentication();
            app.UseWebSockets();
            app.UseMvc();
        }
Пример #4
0
        public void Configure(IApplicationBuilder app, IServiceProvider prov,
                              ExplorerConfiguration explorerConfiguration,
                              IWebHostEnvironment env,
                              ILoggerFactory loggerFactory, IServiceProvider serviceProvider,
                              CookieRepository cookieRepository)
        {
            cookieRepository.Initialize();
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            Logs.Configure(loggerFactory);
            if (!string.IsNullOrEmpty(explorerConfiguration.InstanceName))
            {
                app.Use(async(httpContext, next) =>
                {
                    httpContext.Response.Headers.Add("instance-name", explorerConfiguration.InstanceName);
                    await next();
                });
            }
#if !NETCOREAPP21
            app.UseRouting();
#endif
            app.UseAuthentication();
#if !NETCOREAPP21
            app.UseAuthorization();
#endif
            app.UseWebSockets();
            //app.UseMiddleware<LogAllRequestsMiddleware>();
#if NETCOREAPP21
            app.UseMvc();
#else
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapHealthChecks("health", new Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions()
                {
                    ResponseWriter = HealthChecks.HealthCheckWriters.WriteJSON
                });
                endpoints.MapControllers();
            });
#endif
        }
Пример #5
0
 public ConfigureCookieFileBasedConfiguration(CookieRepository cookieRepo)
 {
     _CookieRepo = cookieRepo;
 }