kopia lustrzana https://github.com/badgen/badgen.net
live-fns: (lgtm) use default accept header (#132)
rodzic
9246e255f4
commit
6a38ad5355
|
@ -1,15 +1,11 @@
|
|||
const millify = require('millify')
|
||||
|
||||
// Use axios directly as the default Accept header breaks lgtm API
|
||||
const axios = require('axios')
|
||||
const axios = require('../axios.js')
|
||||
|
||||
module.exports = async (topic, ...args) => {
|
||||
const lang = topic === 'grade' ? args.shift() : undefined
|
||||
const projectId = args.join('/')
|
||||
const endpoint = `https://lgtm.com/api/v0.1/project/${projectId}/details`
|
||||
const data = await axios.create({
|
||||
timeout: 3200
|
||||
}).get(endpoint).then(res => res.data)
|
||||
const data = await axios.get(endpoint).then(res => res.data)
|
||||
|
||||
switch (topic) {
|
||||
case 'alerts':
|
||||
|
|
Ładowanie…
Reference in New Issue