title: How do I configure routing for MVC and SignalR in an ASP.NET Core project?
body: <p>I'm trying to build a web app with ASP.NET Core 2.1.0-preview1 and ASP.NET Core SignalR 1.0.0-alpha1 with an Angular4 client. So far I've been able to muddle through and can actually open a SignalR web socket connection from within the client. That came at a price, though, here's an excerpt of my <code>Startup.cs</code>:</p>
  
  <pre><code>app.UseMvc(routes =&gt;
  {
     routes.MapRoute(
        name: "default",
        template: "{controller=Home}/{action=Index}/{id?}");
  
     /*routes.MapSpaFallbackRoute(
        name: "spa-fallback",
        defaults: new { controller = "Home", action = "Index" });*/
  });
  
  app.UseWebSockets();
  app.UseSignalR(routes =&gt;
  {
     routes.MapHub&lt;Feed&gt;("feed");
  });
  </code></pre>
  
  <p>As you can see, I had to disable the "spa-fallback" route, if I didn't do that SignalR would receive plain HTML instead of JSON. The drawback of that, of course, is that I have to enter the exact URL (<code>localhost:12345/home/index</code>, for example) now, which sucks.</p>
  
  <p>So my question is, how can I make MVC routing and SignalR routing live side by side?</p>