title: Pass data using question mark in node.js
body: <p>I want to pass data from <code>.ejs</code> to my node API. For <code>edit</code> a record I'm passing id of the data. </p>
  
  <p>For that I'm usign <code>click</code> event like this. </p>
  
  <pre><code>&lt;input type="button" class="btn btn-primary" value="Edit" onclick="edit(&lt;%= data[i].id %&gt;)"&gt;
  </code></pre>
  
  <p>And I create a function in <code>&lt;script&gt;</code> tag. </p>
  
  <pre><code>function edit(id){
       alert(id);
       window.location.replace('/bill/edit?id='+id);
  }
  </code></pre>
  
  <p>And my API is this. </p>
  
  <pre><code>router.get('/edit/:id', function (req, res, next) {
       console.log("Id is : " , req.query.id);
  }
  </code></pre>
  
  <p>As per I used to before it's right I have search also on it. And it all shows this way but I don't understand that why it's not work for me. </p>
  
  <p>When I run API in <code>postman</code> I got 404 Error. </p>
  
  <pre><code>&lt;h1&gt;Not Found&lt;/h1&gt;
  &lt;h2&gt;404&lt;/h2&gt;
  &lt;pre&gt;Error: Not Found
  at E:\myapp\app.js:30:13
  </code></pre>