faker-brasil
Version:
This library provides fake data for users data from Brazil
20 lines (15 loc) • 553 B
JavaScript
;
const axios = require('axios')
const FLICKR = 'https://loremflickr.com/json/'
const XSGAMES = 'https://xsgames.co/randomusers/avatar.php?g='
class ImageService {
static async getImage(width, height, type = 'abstract') {
let image = await axios.get(`${FLICKR}${width}/${height}/${type}`)
return image.data.file;
}
static async getAvatar(gender) {
let avatar = await axios.get(XSGAMES + gender);
return avatar.request.res.responseUrl;
}
}
module.exports = ImageService;