예제 #1
0
        public static void Configure(IApplicationBuilder app,
                                     IWebHostEnvironment env,
                                     ELPIdentityInitializer identityInitializer)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseCors(c =>
            {
                c.AllowAnyHeader();
                c.AllowAnyMethod();
                c.AllowAnyOrigin();
            });

            app.UseAuthConfiguration();

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

            app.UseSwaggerSetup();

            app.UseAuthentication();

            identityInitializer.Seed().Wait();
        }
예제 #2
0
        public static void Configure(IApplicationBuilder app,
                                     IWebHostEnvironment env,
                                     ELPIdentityInitializer identityInitializer)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseDefaultFiles();
            app.UseStaticFiles();

            app.UseCors("CorsPolicy");

            app.UseAuthConfiguration();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapHub <NumeroBusiness>("/messagehub");
            });

            app.UseSwaggerSetup();

            app.UseAuthentication();

            identityInitializer.Seed().Wait();
        }