title: How to use Express app's API routes as part of main application
body: <p>I have a website that will use EJS templating to display data from my database. Instead of creating a second API just to do this, I would like to use the pre-existing API that other developers can use. Is there a way to get data from my API in the most meta way possible.</p>
  <p>main app route</p>
  <pre class="lang-js prettyprint-override"><code>app.get(&quot;/facts/random&quot;, async (req, res) =&gt; {
    /* Make request to /api/random here and get JSON data */
  });
  </code></pre>
  <p>API route</p>
  <pre class="lang-js prettyprint-override"><code>app.get(&quot;/api/random/&quot;, async (req, res) =&gt; {
    let results = await Fact.find();
    const randomResult = Math.floor(Math.random() * results.length);
    return res.json(results[randomResult]);
  })
  </code></pre>
  <p>I want to make a request from the first route to the second route using the most meta way possible.</p>