Ejemplo 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, SeedDB seeder, UploadManager uploadManager)
        {
            seeder.Run();
            uploadManager.CheckFoldersExist();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseAuthentication();
            //app.UseHttpsRedirection();
            app.UseMvc();

            //app.UseCors("CorsPolicy");
            app.UseSignalR(routes => {
                routes.MapHub <MapShapeHub>("/ws/map-shape");
            });
            app.UseStaticFiles(new StaticFileOptions()
            {
                FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), @"Upload")),
                RequestPath  = new PathString("/upload")
            });
        }