title: How to close connection in node js mssql?
body: <p>I'm using <code>mssql</code> npm for connecting to SQL Server. When I connect to the database and get or post data, the connection is open yet. How can I close the connection after each request?</p>
  
  <p>This is a kind of request I use:</p>
  
  <pre><code>router.get('/getnotification/:userid',async(req,resp,next)=&gt;{
      (async function(){
          let pool = null;
          try{
              pool = await connection
              let result = await pool.request()
              .input('input_id',sql.BigInt,req.params.userid)
              .query(`exec showNotification 0,@input_id`)
  
              if(result){
                  resp.status(200).send(result.recordset).end;
              }
              //  pool.close()
          }catch(err){
                  resp.status(500).send(err).end;
              //  pool.close()  
          }
  
      })()
  })
  </code></pre>
  
  <p>I also use <code>pool.close()</code> after request is done but for next request connection is closed.</p>