Exemplo n.º 1
0
        /// <summary>
        /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        /// </summary>
        /// <param name="application"></param>
        /// <param name="loggerFactory"></param>
        /// <param name="apiVersionDescriptionProvider"></param>
        public void Configure(IApplicationBuilder application,
                              ILoggerFactory loggerFactory,
                              IApiVersionDescriptionProvider apiVersionDescriptionProvider)
        {
            if (environment.IsEnvironment(EnvironmentTypes.Local))
            {
                application.UseDeveloperExceptionPage();

                application.UseStaticFiles();

                SwaggerStartupConfiguration.Configure(application, apiVersionDescriptionProvider);
            }

            CorrelationMiddleware.Configure(application);

            if (EnvironmentVariables.GetInMemoryDbValue())
            {
                var context = application.ApplicationServices.GetService <DataContext>();
                //MockDataInjector.Inject(context);
            }
            application.UseMvc();
        }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            //if (env.IsDevelopment())
            if (true)
            {
                app.UseDeveloperExceptionPage();
                app.UseSwagger();
                SwaggerStartupConfiguration.Configure(app);
            }
            app.UseAuthentication();
            app.UseHttpsRedirection();
            app.UseRouting();

            //Habilitar Cors
            //app.UseCors();
            app.UseCors("FaceRecognition");

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