title: Why are the angular wildcard routes resolving so slowly when rendering the app server side using express.js?
body: <p>I have an angular app where the last routes in the routing table are as follows:</p>
  <pre><code>{ path: &quot;not-found&quot;, redirectTo: &quot;404&quot; },
  { path: &quot;404&quot;, component: NotFoundComponent },
  { path: &quot;**&quot;, redirectTo: &quot;404&quot; }
  </code></pre>
  <p>If I attempt to access a non-existing route, I end up on 404 as expected. However, this takes up to 20 seconds when rendering the app on an express.js server. Why?
  I enabled router tracing, but absolutely nothing happens for about 19 seconds and then suddenly, the route resolves as expected...</p>
  <p>The express server is setup to render all routes using the angular router:</p>
  <pre><code>server.get(&quot;*&quot;, (req, res) =&gt; {
      return res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
    });
  </code></pre>