title: Error cannot POST when using REST api and Node.js
body: <p>I have problems with the REST API.</p>
  
  <p>I have a file named Route. In which I make a request that is then passed to the server where it is called. In my third request, I want to select an ID to pass it as an API and write to call the page inside/:id, but I only get an error (This is a POST request)</p>
  
  <p><em>Error: Cannot POST /inside</em></p>
  
  <p>Route.js</p>
  
  <pre><code>const post_inside = (req, res) =&gt; {
      var config = {
          user:'postgres',
          database:'my',
          password: '1',
          host:'localhost',
          port:5432,
          max:10,
          idleTimeoutMillis: 30000
      }
      var pool = new pg.Pool(config)
  
      pool.connect(function(err, client, done){
          if(err){
              return console.error('error')
          }
  client.query("SELECT *,to_char(data_roz::date , 'YYYY-MM-DD') as data_roz from sch.idv_p where phone=$1",[req.body.login], function(err, result){
  done()
  return_data.pupil2 =result
  if (err) {
  res.end()
  return console.error("error")
  }
  client.query('select * from table1 ($1,$2)',[req.body.login,req.body.date], function(err, result){
  return_data.discipline =result 
  if (err){
  res.end()
  return console.error("error")
  } 
  
  
  //3 HERE
  client.query("select id from table3 where phone=$1",[req.body.login], function(err, result){
      return_data.id =result 
      if (err){
      res.end()
      return console.error("error")
      }
  
   res.render('inside',{pupil2:return_data.pupil2,discipline:return_data.discipline,id:return_data.id})
      })})}}
  
  
  module.exports = {
      post_inside
  }
  </code></pre>
  
  <p>server.js</p>
  
  <pre><code>app.post('/inside/:id',urlencodedParser,db.post_inside)
  </code></pre>
  
  <p>I want to call the same file, but for example as inside/2124</p>