How set boolean logic in node.js based on Twitch API?

I did what you said and my const online is coming undefined

how do I call the result of another function to use it inside my app.listen?

I’ve trid to use .then and after that I tried with await, but its the same answer: undefined

   app.get('/endpoint', (req, res) => {
      exibir().then((on) => {
          res.statusCode = 200;
          res.setHeader('Content-Type', 'text/plain');
          const lgtaon = 'is_live:'
          console.log('on é ' + on)
          if (on == false) {
              res.send(lgtaon + 'false')
              console.log('lg ta offline')
          } else {
              res.send(lgtaon + 'true')
              console.log("lg ta online");
          }
      });
  });