title: How to load CSS and Bootstrap files into server using node.js?
body: <p>I have a html file called myfile.html that displays 'Hello World'. My css file called myfile.css is used to insert background image. My bootstrap files are used to insert a image in the form of a circle.</p>
  
  <p>The HTML file is as follows:</p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
   &lt;html&gt;
       &lt;head&gt;
           &lt;title&gt;MY FILE&lt;/title&gt;
           &lt;link rel="stylesheet" type="text/css" href="public\css\bootstrap.css"&gt;
           &lt;link rel="stylesheet" type="text/css" href="public\myfile.css"&gt;
       &lt;/head&gt;
       &lt;body&gt;
           &lt;h1&gt;Hello World!!&lt;/h1&gt;
  
           &lt;img src="public\pinky.jpg"  class="img-circle"&gt;
       &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>My CSS file is as follows:</p>
  
  <pre><code>body {
      background-image: url('fishy.jpg');
  }
  </code></pre>
  
  <p>My node.js file called new.js is as follows:</p>
  
  <pre><code>  const express = require('express')
    const app = express()
    app.use(express.static('public'))
  
    app.get('/',function (req,res) {
            console.log(__dirname)
            res.sendFile(__dirname+"/myfile.html")
    })
  
    app.listen(3000, function() {
            console.log('Example app listening on port 3000!')
    })
  </code></pre>
  
  <p>My main folder is called Bootsstrap and it has the following contents:</p>
  
  <pre><code>     Bootsstrap
            -myfile.html
            -public /*Folder*/
  
           /*inside public folder*/
            -myfile.css
            -css
            -js
            -fonts
            -fishy.jpg /*background image*/
            -pinky.jpg /*circular image*/
  </code></pre>
  
  <p>I open Command Prompt from Bootsstrap folder and run </p>
  
  <pre><code>           node new.js
  </code></pre>
  
  <p>I get the message as:</p>
  
  <pre><code>          'Example app listening on port 3000!'
  </code></pre>
  
  <p>When I open Chrome Browser and type localhost:3000, I get only 'Hello World'.The images are not getting displayed. I get an <a href="https://i.stack.imgur.com/CQYCJ.jpg" rel="nofollow noreferrer">Error</a> 404.</p>
  
  <p>What can I do in order to run my HTML file in server using node.js by including all my css and bootstrap files? </p>