title: Display images in HTML + Nodejs
body: <p>I am new to nodejs. I want to create a very simple website which has 3 pages. In every page I want to display an image to make the pages look uniform.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>    /**
       * Module dependencies.
       */
  
      var express = require('express');
      var routes = require('./routes');
      var user = require('./routes/user');
      var http = require('http');
      var path = require('path');
      var fs = require('fs');
      var mail = require("nodemailer").mail;
  
  /*List of variables*/
  
  var app = express();
  
  // all environments
  app.set('port', process.env.PORT || 3000);
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'jade');
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.json());
  app.use(express.urlencoded());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));
  
  app.get('/main', function(req, res) {
  
      fs.readFile('./home.html', function(error, content) {
          if (error) {
              res.writeHead(500);
              res.end();
          }
          else {
              res.writeHead(200, { 'Content-Type': 'text/html' });
              res.end(content, 'utf-8');
          }
      });
  
  });
  
  /* After this I have code for post event - all these navigation works perfectly fine*/
  </code></pre>
  
  <p>in <code>home.html</code> file I have an image to display:</p>
  
  <pre><code>/*Header part of HTML file*/
  
  &lt;body&gt;
  
          &lt;img class="logo" src="./Heading.png" alt="My_Logo"&gt;
          console.log (src);
          &lt;h1 class="center"&gt;Welcome to message reprocessing&lt;/h1&gt;
      &lt;/br&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>This image is not displayed in my browser. When I check my console I have this error:</p>
  
  <pre><code>GET http://localhost:3000/Heading.png 404 (Not Found) 
  </code></pre>
  
  <p>Please help, thanks</p>