time-rs/time status badge

node v10.22.1
version: 0.0.0
endpointsharetweet
const axios = require('axios'); exports.endpoint = async function (req, response) { const { message } = (await axios.get('https://img.shields.io/github/workflow/status/time-rs/time/Build.json')).data; response.setHeader('Content-Type', 'application/json'); if (message === 'passing') { response.end(JSON.stringify({ schemaVersion: 1, label: 'Build', message: 'passing', namedLogo: 'github', style: 'for-the-badge', color: '779a6b', })); } else { response.end(JSON.stringify({ schemaVersion: 1, label: 'Build', message: 'failing', namedLogo: 'github', style: 'for-the-badge', color: 'c18170', })); } }
Loading…

no comments

    sign in to comment