title: serving files to a route without using path file in url on Express
body: <p>I'am serving files to my localhost on Express with this :</p>
  <pre><code>app.use(express.static('../../StockChart/'))
  
  //StockChart is a dir which contains more dirs and files.
  
  </code></pre>
  <p>With this I can serve the files I want by simply writting down the path on the url , like :</p>
  <pre><code>http://localhost:3000/HomePage/HomePage.html
  
  </code></pre>
  <p>But what If I want to serve this same file (with CSS and JS files linked to it) , only to another route like : &quot;/&quot;  ?</p>
  <p>I tried this :</p>
  <pre><code>app.get('/', (req, res) =&gt; {
    res.sendFile(&quot;C:/Users/Simon/Desktop/Portfolio/Learning Projects vanilla JS/StockChart/HomePage/HomePage.html&quot;)
  })
  </code></pre>
  <p>This only sends HTML and not the JS and CSS linked files.</p>
  <p>What can/should I do to serve the files to the specific route.</p>
  <p>I followed the express documentation on this link : <a href="https://expressjs.com/en/starter/static-files.html" rel="nofollow noreferrer">https://expressjs.com/en/starter/static-files.html</a></p>