コード例 #1
0
ファイル: Startup.cs プロジェクト: Makulak/ListNest-Backend
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public override void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();
            app.UseRouting();
            app.UseCors();
            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapHub <ListHub>("/hubs/lists");
            });

            var userManager = serviceProvider.GetService <UserManager <ListNestUser> >();

            DatabaseSeeder.AddAdminAsync(userManager, "*****@*****.**", "Admin", "Admin").GetAwaiter().GetResult();

            base.Configure(app, env, serviceProvider);
        }