/**
* https://stackoverflow.com/questions/50122026/#50122101
*
* USAGE:
* https://badgen.net/
*/
const url = require('url')
const qs = require('querystring')
const { send } = require('micro')
const axios = require('axios')
exports.endpoint = async function (req, res) {
const { args } = qs.parse(url.parse(req.url).query)
const endpoint = `http://api.getsatisfaction.com/companies/${args}.json`
const { approximate_people_count } = await axios(endpoint).then(res => res.data)
send(res, 200, {
subject: 'people count',
status: approximate_people_count,
color: 'blue'
})
}