title: How to let input appear in path without ?search in NODEjs?
body: <p>Hi I am doing a NodeJS practice and I would like to let the input appear on the url as (website).com/results/NameOfCountry, where NameOfCountry is a variable containing the input by the user.
  I don't know how to do it after trying path.dirname(), which I don't think is correct.</p>
  
  <p>Everytime I key in the country name, it would show a link ending like /results?searchCountry=America and I'd like to get rid of the ?searchCountry because the correct path has an ending like /results/America</p>
  
  <p>Could anyone help me with this? Thanks in advance.</p>
  
  <p>Here's the Code
  <strong>NodeJS:</strong></p>
  
  <pre><code>var express = require("express");
  var haste = express();
  var bp = require("body-parser");
  var request = require("request");
   var mime=require('mime-types');
  
  haste.set("view engine", "ejs");
  
  haste.get("/", function(req, res){
      res.render("search");
  })
  
  haste.get("/results", function(req, res){
      var apple = "https://api.covid19api.com/total/country/" + query;
      var query = req.you.value;
      request(apple, function(error, response, require){
          if(!error &amp;&amp; response.statusCode == 200){
              var data = JSON.parse();
              res.render("info", {data:data});
          }
      })
  })
  
  
  
  haste.listen(process.env.PORT || 3000, process.env.IP, function(){
      console.log("Server has started!");
  });
  </code></pre>
  
  <p>On EJS, here's how the input form is:</p>
  
  <pre><code>&lt;h1&gt;
      Find Cases By Country:
  &lt;/h1&gt;
  &lt;form action="/results" method="GET"&gt;
      &lt;input type="text" placeholder="enter country" class="you"&gt;
      &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>