在 NodeJS 中设置不记名令牌

Set bearer token in NodeJS

我有一个使用 NodeJS 的网络后端。我想使用 link(例如 https://evoDMSTDev/api/api_event_all.php)从另一台服务器检索数据,并且必须使用不记名令牌(例如 71D55F6907509)来访问它。那么,我必须在哪里设置令牌以便检索该数据并将其显示在我的网络后端?

感谢您的帮助:)

我在node js中这样创建,然后在你的.ejs

中调用obj
request({
    uri : 'https://evoDMSTDev/api/api_events_all.php',
    auth: {
        'bearer': '71D55F99570209'
    },
    rejectUnauthorized: false,//add when working with https sites
    requestCert: false,//add when working with https sites
    agent: false,//add when working with https sites
}, function(error, response, body) {
      if (error) {
         console.log(error);
      } else {
         obj = JSON.parse(body);
      }
}