Ejemplo n.º 1
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     JwtStarter.InitJwtTokenAuth(services);
     services.AddControllers();
     services.AddHttpContextAccessor();
     SingletonStarter.RegisterSingleton(services);
     HealthCheckStarter.InstallHealthChecks(services);
 }
Ejemplo n.º 2
0
        public static void SetApplicationSettings(IApplicationBuilder app)
        {
            app.UseHttpsRedirection();
            app.UseRouting();
            app.UseCors(x => x
                        .AllowAnyOrigin()
                        .AllowAnyMethod()
                        .AllowAnyHeader());

            app.UseAuthentication();
            app.UseAuthorization();
            HealthCheckStarter.InitializeHealthChecks(app);
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }