コード例 #1
0
ファイル: Startup.cs プロジェクト: maximiliysiss/seac
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IAuthDataProvider authDataProvider, ILogger <Startup> logger, IHostApplicationLifetime hostApplicationLifetime)
        {
            logger.LogInformation($"Connection string: {Configuration.GetConnectionString("SQLServer")}");

            authDataProvider.ApplyChanges();
            app.RegisterWithConsul(hostApplicationLifetime);

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseSwaggerWithUI(Configuration["ApiInfo:Name"], Configuration["ApiInfo:Version"]);
            app.UsePrometheusMetric();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }