コード例 #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
ファイル: Startup.cs プロジェクト: carlosandres842/test
        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
ファイル: Startup.cs プロジェクト: yashbhutwala/NBXplorer
        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
ファイル: Startup.cs プロジェクト: hollow87/NBXplorer-1
        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
ファイル: Extensions.cs プロジェクト: uzbekdev1/NBXplorer
 public ConfigureCookieFileBasedConfiguration(CookieRepository cookieRepo)
 {
     _CookieRepo = cookieRepo;
 }