title: How to redirect to another page when click on hyperlink href using node js?
body: <p><strong>server.js:</strong></p>
  
  <pre><code>var http = require('http');
  var fs = require('fs');
  
  function onRequest(request,response){
      response.writeHead(200, {'content-Type':'text/html'});
      fs.readFile('./index.html',null,function(error,data){
          if(error) 
          {
              response.writeHead(404);
              response.write('File not found');
          }
          else
          {
              response.write(data);
          }
          response.end();
      });
      fs.readFile('./about.html',null,function(error,data){
          if(error) 
          {
              response.writeHead(404);
              response.write('File not found');
          }
          else
          {
              response.write(data);
          }
          response.end();
      });
  }
  
  http.createServer(onRequest).listen(8080);
  </code></pre>
  
  <p>I am new in Node.js where I have created a simple HTML page i.e. <code>index.html</code> and <code>about.html</code> inside the folder. I had also created a <code>server.js</code>. </p>
  
  <p>Now, when I run a command on <code>cmd</code> and run on <code>localhost:8080</code> then index.html page are showing but when I click on hyperlink i.e. <code>&lt;a href="about.html"&gt;&lt;/a&gt;</code> then it not working. </p>
  
  <p>So, How can I create a hyperlink in node js? </p>