title: How to create custom middleware in express?
body: <p>I need custom middle ware in express with routes with promise to perform specific task. Below is the sample code that would neededenter code here:</p>
  
  <pre><code>   function middle(){
     // some code;
     }
     app.get('/', middle, function (req, res) {
        console.log('url is working');
        res.send("Chat server is working!");
     });
  </code></pre>