Exemplo n.º 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)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            app.UseMvc(route => {
                route.MapRoute(
                    name: "defaultApi",
                    template: "api/{controller}/{action}/{id?}");
            });

            //hangfire dashboard
            JobStorage.Current = new Hangfire.SqlServer.SqlServerStorage(Configuration.GetConnectionString("HangFireDBConnectionString"));
            var schedulerModel = new SchedulerModel();

            schedulerModel.AddSchedulerJob();

            app.UseHangfireDashboard("/jobs", new DashboardOptions
            {
                AppPath = ""
            });
            app.UseHangfireServer();
        }