0
const axios = require('axios');
require('dotenv').config();

const apiUsers = async (req, res) => {
  let { since } = req.query

    const { data, headers } = await axios.get(`https://api.github.com/users?since=${since}`, 
       headers: {
        'Authorization': 'token' + process.env.AUTH_TOKEN
      }
    });

Result = enter image description here

if the token is passed correctly, the request limit should be 5000

My .env archive below: enter image description here

1 Answers1

0

Solved In this case the answer is 'Authorization': 'token ' + process.env.AUTH_TOKEN The problem is the empty space after token... i forgot, but now is right!