title: Express JS use async function on requests
body: <pre><code>app.use(async function(req, res, next) {
      try {
          var myres = await new Promise((resolve, reject) =&gt; {
              mysql_connection.query("select * from Users;", (err, rows) =&gt; {
                  if (err) {
                      reject(err);
                  } else {
                      resolve(rows);
                  }
              });
          });
      } catch (error) {
          console.log(error);
      }
  });
  </code></pre>
  
  <p>Question is. using async function to be able to use await for DB queries is ok? i am afraid that it can cause some problems on expressjs side.</p>