title: node/express anchor link route
body: <p>I am making a website and for the frontend, I am using HTML. For the backend, I am using node/Express. </p>
  
  <p>In HTML, I have some anchor tag that redirects different HTML page. To create different routes I used Router in Express. </p>
  
  <p>Now the problem is when I run my website through node then the redirection is not working as expected. </p>
  
  <p>index.html: </p>
  
  <pre><code>        &lt;li&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="publication.html"&gt;Publication&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="team.htm"&gt;Team&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="contact.html"&gt;Contact&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>ExpressJS:</p>
  
  <p>index.js:</p>
  
  <pre><code>  var express = require('express');
    var path = require('path');
    //router object
   var router = express.Router();
  
   router.get('/', function (req, res) {
    res.sendFile(path.join(__dirname, '..', '/public/html/index.html'));
   });
  
    module.exports = router;
  </code></pre>
  
  <p>publication.js:</p>
  
  <pre><code>   var express = require('express');
     var path = require('path');
  
    //router object
    var router = express.Router();
  
    router.get('/publication', function(req, res){
      res.sendFile(path.join(__dirname, '..', '/public/html/publication.html'));
    });
  
    module.exports = router;
  </code></pre>
  
  <p>When I run the website through node and type: </p>
  
  <blockquote>
    <p>localhost:3000/publication</p>
  </blockquote>
  
  <p>then I am getting the publication.html and when I type </p>
  
  <blockquote>
    <p>localhost:3000 </p>
  </blockquote>
  
  <p>it opens the index.html and in my index page, I have above anchor tags. 
  Now if I click any of my anchor tags then I am getting an error message like "cannot get publication.html" what I want is to redirect to my publication.js and calls the </p>
  
  <pre><code>router.get('/publication')
  </code></pre>
  
  <p>method and then open the publication.html</p>
  
  <p>Can anyone point me to the right direction?</p>