Exemplo n.º 1
0
        public void ConfigureServices(IServiceCollection services)
        {
            var key = Configuration.GetSection("JwtSettings:SigningKey").Value;

            services.AddAuthentication(x =>
            {
                x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                x.DefaultChallengeScheme    = JwtBearerDefaults.AuthenticationScheme;
            })
            .AddJwtBearer(x =>
            {
                x.RequireHttpsMetadata      = false;
                x.SaveToken                 = true;
                x.TokenValidationParameters = Token.TokenParametersConfig(key);
            });

            services.AddMediatR(typeof(Startup).Assembly);
            services.AddAutoMapper(typeof(CriarUsuarioHandler).Assembly);
            services.AddControllers().AddNewtonsoftJson();

            services.Configure <DronePontoInicialConfig>(Configuration.GetSection("BaseDrone"));
            services.AddApplicationInsightsTelemetry(Configuration["APPINSIGHTS_INSTRUMENTATIONKEY"]);

            HttpPagamentoClient.Registrar(services, Configuration["UrlBasePagamento"]);
            Swagger.Configurar(services);

            var producerConfig = new ProducerConfig();

            Configuration.Bind("Producer", producerConfig);

            services.Configure <MongoDbConfig>(Configuration.GetSection("Mongo"));

            DependencyContainer.RegisterServices(services, producerConfig);
        }
Exemplo n.º 2
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            Swagger.Configurar(services);

            services.AddScoped <IPedidoProducerService, PedidoProducerService>();
            services.Configure <KafkaConfig>(Configuration.GetSection("Kafka"));
        }
Exemplo n.º 3
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers().AddNewtonsoftJson();

            services.AddMediatR(typeof(Startup).Assembly);

            //Adicionar acesso aos endpoint do microservico de entregas
            HttpPedidoClient.Registrar(services, Configuration["UrlBasePedido"]);

            Swagger.Configurar(services);
            DependencyContainer.RegisterServices(services);
        }
Exemplo n.º 4
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            Swagger.Configurar(services);

            services.AddScoped <IOperationCreate, Create>();

            services.AddScoped <IOperationRepository, OperationRepository>();
            services.AddScoped <MongoDbContext>();

            services.Configure <DbConfig>(Configuration.GetSection("MongoDb"));
        }
Exemplo n.º 5
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers().AddNewtonsoftJson();

            services.AddMediatR(typeof(Startup).Assembly);

            HttpPedidoClient.Registrar(services, Configuration["UrlBaseEntrega"]);
            Swagger.Configurar(services);

            var producerConfig = new ProducerConfig();

            Configuration.Bind("Producer", producerConfig);
            DependencyContainer.RegisterServices(services, producerConfig);
        }