Example #1
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();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();   //https
            app.UseStaticFiles();

            var localizationOptions = new RequestLocalizationOptions();

            localizationOptions.SetDefaultCulture("en").AddSupportedCultures("en", "hy").AddSupportedUICultures("en", "hy");

            app.UseRequestLocalization(localizationOptions);

            app.UseRouting();

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

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

            DatabaseSeed.DataSeed(app.ApplicationServices, _configuration);
            DatabaseSeed.CreateAdminAccount(app.ApplicationServices, _configuration);
        }