Пример #1
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, IFillRole fillRole2)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            //app.UseApplicationInsightsExceptionTelemetry();

            app.UseStaticFiles();


            //obsolete
            // app.UseIdentity();



            app.UseAuthentication();


            app.UsePathBase("/RNalog");

            // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715



            //postavke CORS-a
            app.UseCors(builder => builder.AllowAnyOrigin()
                        .AllowAnyHeader()
                        .AllowAnyMethod());


            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });



            //provaj dohvatit servis
            // var fillRole2 = app.ApplicationServices.GetRequiredService<IFillRole>();
            //var testContext = app.ApplicationServices.GetService<ApplicationDbContext>();


            fillRole2.testFill();
            fillRole2.createRolesandUserstest();



            // var webRootPath = env.WebRootPath;
            // call rotativa conf passing env to get web root path
            RotativaConfiguration.Setup(env);

            Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.DisableTelemetry = true;
        }
Пример #2
0
 public HomeController(IFillRole fillrole)
 {
     this.fillrole = fillrole;
 }