I'm trying to await for this API call to complete before sending it to the client in an express route. I have provided the entire route below. The API call returns the required data but I can't get the data outside of the .get function.
    let getAgents = async () => {
        let agents = await httpntlm.get({
            url: `http://localhost:8080/api/agents?PageNumber=${req.params.pageNumber}&PageSize=${req.params.pageSize}`,
            username: 'xxxx',
            password: 'xxxx',
            domain: 'xxxx',
            workstation: 'xxxx',
        }, function(err, res){
            return res.body;
        })
    }
    let data = getAgents().then(res => return res);
    return res.json(data);
})
