// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IMyFileWatcher watcher) { if (env.IsDevelopment()) { // app.UseDeveloperExceptionPage(); //app.UseAuthentication(); } _watcher = watcher; app.UseFileServer(); app.UseSignalR(routes => { routes.MapHub <FileWatcherHub>("/fileWatcherHub"); }); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); app.Run(async(context) => { await context.Response.WriteAsync("Hello World!"); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IMyFileWatcher watcher) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } _watcher = watcher; app.UseFileServer(); app.UseSignalR(routes => { routes.MapHub <FileWatcherHub>("/fileWatcherHub"); }); app.Run(async(context) => { await context.Response.WriteAsync("Hello World!"); }); }