title: why are my static files failing to load response
body: <p>i am trying to get data from a html form using express
  but when i try to load my static files with app.use(express.static(__dirname+&quot;public&quot;);
  in the devtools it is showing that it failed to load my response data
  can anyone tell me why this is happening and a solution for this
  <a href="https://i.stack.imgur.com/9Mkfp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Mkfp.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/ya5M0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ya5M0.png" alt="enter image description here" /></a></p>
  <p>here is the code in the first image</p>
  <pre><code> const express = require('express');
  
   const bodyParser = require('body-parser');
  
   const app = express();
  
  
  
  
  app.use(bodyParser.urlencoded({extended:true}));
  app.use(express.static(__dirname+'public'));
  
  
  app.get(&quot;/&quot;,function(req,res){
    res.sendFile(__dirname + &quot;/public/bmiCalculator.html&quot;);
  });
  
  app.post(&quot;/&quot;,function(req,res){
    console.log(req.body);
    res.send(&quot;hello&quot;);
  });
  
  
  app.listen(300,function(){
    console.log(&quot;Server Hosted OK&quot;);
  });
  </code></pre>