Example #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)
        {
            GlobalConfiguration.Configuration.UseMemoryStorage();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }
            app.UseCors("producPolity");
            app.UseMvcWithDefaultRoute();
            app.UseStaticFiles();
            app.UseHangfireDashboard();
            app.UseHangfireServer();
            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "prueba");
            });
            app.UseHttpsRedirection();
            ProductService productoService = new ProductService();

            RecurringJob.AddOrUpdate(() => productoService.ActualizarFechaRevisonProducto(), Cron.Minutely());
            app.UseMvc();
        }