title: ExpressJS for rendering content on a GET request
body: <p>I have an html page as below</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;&lt;meta charset="utf-8"/&gt;
  &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"/&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"/&gt;
  &lt;title&gt;Report&lt;/title&gt;
  &lt;link rel="stylesheet" href="assets/app.css"/&gt;&lt;/head&gt;&lt;body&gt;
  
  //Content//
  
  &lt;div id="report"&gt;&lt;/div&gt;&lt;script src="assets/app.js"&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>This html page lies on below folder with structure</p>
  
  <pre><code>report
     --assets
        --app.js
        --app.css
     --myfile.html
  </code></pre>
  
  <p>Now i have my application which is trying to render this html. Below is located in routes.js and the structure is as follows</p>
  
  <pre><code>app.use('/Users/report/assets', express.static('/Users/report/assets'));
  app.get('/api/testresults/:id', (req, res) =&gt; {
      const id = req.params.id;
      res.sendFile('/Users/report/myfile.html');
    });
  </code></pre>
  
  <p>My Application structure is as following</p>
  
  <pre><code>MyApp 
  app 
   —routes
      —index.js
      —routes.js
  node_modules
  package.json
  server.js
  </code></pre>
  
  <p>What should i add here. I do not want to change the html as i believe it should be able to find the files once i use express.static()
  I keep on getting the error app.js not found 404</p>
  
  <p>NOTE : If I change href of my html to </p>
  
  <pre><code>/Users/report/assets/app.js 
  </code></pre>
  
  <p>and same for css, it works but i do not want that.</p>