// 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())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseRouting();

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

            //configuração de CORS
            CorsConfiguration.UseCors(app);

            //configuração do JWT
            JwtConfiguration.UseJwt(app);

            //configuração do swagger
            SwaggerConfiguration.UseSwagger(app);

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            LoggingConfiguration.ConfigureLogging(app, env, loggerFactory, Configuration);
            app.UseAuthentication();
            SwaggerConfiguration.AddSwagger(app);
            CorsConfiguration.UseCors(app);
            if (!env.IsDevelopment())
            {
                var context = app.ApplicationServices.GetService <PgsKanbanContext>();
                context.Database.Migrate();
            }

            SignalRConfiguration.UseSignalR(app);
            app.UseMvc();
        }
Beispiel #3
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())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseRouting();

            //Setup para configuração do CORS
            CorsConfiguration.UseCors(app);

            JwtConfiguration.Configure(app);

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

            //Setup para configuração do Swagger
            SwaggerConfiguration.UseSwagger(app);
        }