├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── api ├── [owner] │ └── [repo].ts ├── index.ts └── ratelimit.ts ├── assets ├── flat-square │ ├── error.svg │ ├── failed.svg │ ├── none.svg │ ├── passing.svg │ └── pending.svg ├── flat │ ├── error.svg │ ├── failed.svg │ ├── none.svg │ ├── passing.svg │ └── pending.svg ├── for-the-badge │ ├── error.svg │ ├── failed.svg │ ├── none.svg │ ├── passing.svg │ └── pending.svg └── plastic │ ├── error.svg │ ├── failed.svg │ ├── none.svg │ ├── passing.svg │ └── pending.svg ├── package-lock.json ├── package.json └── vercel.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .vercel 3 | .env -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | This repo is open to your contributions! Any improvements are greatly appreciated. 4 | 5 | If you'd like to contribute please do the following: 6 | 7 | - Identify an issue, bug or improvement that could be made. 8 | - Fork this repo, clone to your machine. 9 | - Run `npm install`. 10 | - Make sure you have the Vercel CLI installed globally and run `vercel dev`. 11 | - Add your changes and test them locally. 12 | - Commit your changes and open a pull request. 13 | - Apply any proposed changes by the maintainers. 14 | - It's merge time, baby! 😎 15 | 16 | If you're not sure on how you should go about adding your changes, or want to discuss minor details, then feel free to open an issue and discuss the ideas with maintainers and other community members! 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 ejer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vercel-badge 2 | 3 | ![Vercel](https://vercelbadge.vercel.app/api/datejer/vercel-badge) 4 | 5 | Simple serverless service/utility for embedding a Vercel deployment badge in your public github repository or on your website. 6 | 7 | ## Usage 8 | 9 | ``` 10 | ![Vercel](https://vercelbadge.vercel.app/api/[owner]/[repo]) 11 | ``` 12 | 13 | Replace `[owner]` with the username of the repo owner, or the organization name under which the repository is located. 14 | 15 | Replace `[repo]` with the repository name. 16 | 17 | (optional) Add the `?style=` parameter to change the visual badge style. 18 | 19 | | Parameter | Types | Description | Example | 20 | | --------- | ------------------------------------------------------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------- | 21 | | style | Default: `flat`
Available: `flat`, `flat-square`, `for-the-badge`, `plastic` | Select the visual style for your badge. | `https://vercelbadge.vercel.app/api/datejer/vercel-badge?style=for-the-badge` | 22 | 23 | ## Examples 24 | 25 | These are all of the possible Vercel deployment statuses. (`flat` style) 26 | 27 | ![Passing Demo](https://vercelbadge.vercel.app/assets/flat/passing.svg) 28 | ![Pending Demo](https://vercelbadge.vercel.app/assets/flat/pending.svg) 29 | ![Failed Demo](https://vercelbadge.vercel.app/assets/flat/failed.svg) 30 | ![None Demo](https://vercelbadge.vercel.app/assets/flat/none.svg) 31 | 32 | --- 33 | 34 | `flat-square` style: ![Passing Flat Square Demo](https://vercelbadge.vercel.app/assets/flat-square/passing.svg) 35 | 36 | `for-the-badge` style: ![Passing For The Badge Demo](https://vercelbadge.vercel.app/assets/for-the-badge/passing.svg) 37 | 38 | `plastic` style: ![Passing Plastic Demo](https://vercelbadge.vercel.app/assets/plastic/passing.svg) 39 | 40 | --- 41 | 42 | ## Ratelimits 43 | 44 | This project uses the GitHub API with an OAuth app's ID and Secret to authenticate requests in order to up the ratelimit to 5k requests per hour. The publicly available deployment uses my private OAuth app credentials, so it's highly advised to deploy your own Vercel instance with your own credentials to avoid ratelimiting, especially with bigger projects. 45 | 46 | You can check the current GitHub API ratelimit by GETing /api/ratelimit 47 | 48 | ``` 49 | GET https://vercelbadge.vercel.app/api/ratelimit 50 | ``` 51 | 52 | ## Deploying 53 | 54 | [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fdatejer%2Fvercel-badge%2Ftree%2Fmaster) 55 | 56 | You can deploy your own Vercel instance of this project. In order to do that you must create a GitHub OAuth app and pass the Client ID and Client Secret as two environment variables. (respectively `ID` and `SECRET`) 57 | 58 | ## Contributing 59 | 60 | Please refer to [CONTRIBUTING.md](/CONTRIBUTING.md) 61 | -------------------------------------------------------------------------------- /api/[owner]/[repo].ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import path from "path"; 3 | import fs from "fs"; 4 | 5 | import type { VercelRequest, VercelResponse } from "@vercel/node"; 6 | 7 | export default function handler(req: VercelRequest, res: VercelResponse) { 8 | const { owner, repo } = req.query; 9 | 10 | if (!owner || typeof owner !== "string") { 11 | res.statusCode = 400; 12 | return res.json({ message: "Please input the repository owner!" }); 13 | } 14 | 15 | if (!repo || typeof repo !== "string") { 16 | res.statusCode = 400; 17 | return res.json({ message: "Please input the repository name!" }); 18 | } 19 | 20 | let style; 21 | if (!req.query.style) style = "flat"; 22 | else if ( 23 | req.query.style === "flat" || 24 | req.query.style === "flat-square" || 25 | req.query.style === "for-the-badge" || 26 | req.query.style === "plastic" 27 | ) 28 | style = req.query.style; 29 | 30 | axios 31 | .get(`https://api.github.com/repos/${owner}/${repo}/deployments`, { 32 | headers: { 33 | Authorization: `Basic ${Buffer.from( 34 | `${process.env.ID}:${process.env.SECRET}` 35 | ).toString("base64")}`, 36 | }, 37 | }) 38 | .then((response) => { 39 | if (response.data.length <= 0) { 40 | res.setHeader("Content-Type", "image/svg+xml"); 41 | return fs 42 | .createReadStream( 43 | path.join(__dirname, `../../assets/${style}/none.svg`) 44 | ) 45 | .pipe(res); 46 | } 47 | 48 | const vercelDeployments = response.data.filter( 49 | (deployment) => 50 | deployment.creator.login === "vercel[bot]" && 51 | deployment.creator.html_url === "https://github.com/apps/vercel" && 52 | deployment.creator.type === "Bot" 53 | ); 54 | 55 | if (vercelDeployments.length <= 0) { 56 | res.setHeader("Content-Type", "image/svg+xml"); 57 | return fs 58 | .createReadStream( 59 | path.join(__dirname, `../../assets/${style}/none.svg`) 60 | ) 61 | .pipe(res); 62 | } 63 | 64 | const latest = vercelDeployments[0]; 65 | 66 | axios 67 | .get(latest.statuses_url, { 68 | headers: { 69 | Authorization: `Basic ${Buffer.from( 70 | `${process.env.ID}:${process.env.SECRET}` 71 | ).toString("base64")}`, 72 | }, 73 | }) 74 | .then((response) => { 75 | res.setHeader("Content-Type", "image/svg+xml"); 76 | if (response.data[0].state === "success") 77 | return fs 78 | .createReadStream( 79 | path.join(__dirname, `../../assets/${style}/passing.svg`) 80 | ) 81 | .pipe(res); 82 | else if (response.data[0].state === "failure") 83 | return fs 84 | .createReadStream( 85 | path.join(__dirname, `../../assets/${style}/failed.svg`) 86 | ) 87 | .pipe(res); 88 | else if (response.data[0].state === "pending") 89 | return fs 90 | .createReadStream( 91 | path.join(__dirname, `../../assets/${style}/pending.svg`) 92 | ) 93 | .pipe(res); 94 | }); 95 | }) 96 | .catch((error) => { 97 | res.setHeader("Content-Type", "image/svg+xml"); 98 | return fs 99 | .createReadStream( 100 | path.join(__dirname, `../../assets/${style}/error.svg`) 101 | ) 102 | .pipe(res); 103 | }); 104 | } 105 | -------------------------------------------------------------------------------- /api/index.ts: -------------------------------------------------------------------------------- 1 | import { VercelRequest, VercelResponse } from "@vercel/node"; 2 | 3 | export default function handler(req: VercelRequest, res: VercelResponse) { 4 | res.json({ 5 | message: 6 | "Use /[owner]/[repo] to get a Vercel deployment badge for your github repository!", 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /api/ratelimit.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | 3 | import { VercelRequest, VercelResponse } from "@vercel/node"; 4 | 5 | export default function handler(req: VercelRequest, res: VercelResponse) { 6 | axios 7 | .get(`https://api.github.com/rate_limit`, { 8 | headers: { 9 | Authorization: `Basic ${Buffer.from( 10 | `${process.env.ID}:${process.env.SECRET}` 11 | ).toString("base64")}`, 12 | }, 13 | }) 14 | .then((response) => { 15 | return res.status(200).json(response.data); 16 | }) 17 | .catch((error) => { 18 | return res.status(400).json(error.response.data); 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /assets/flat-square/error.svg: -------------------------------------------------------------------------------- 1 | vercel: api errorvercelapi error -------------------------------------------------------------------------------- /assets/flat-square/failed.svg: -------------------------------------------------------------------------------- 1 | vercel: failedvercelfailed -------------------------------------------------------------------------------- /assets/flat-square/none.svg: -------------------------------------------------------------------------------- 1 | vercel: nonevercelnone -------------------------------------------------------------------------------- /assets/flat-square/passing.svg: -------------------------------------------------------------------------------- 1 | vercel: passingvercelpassing -------------------------------------------------------------------------------- /assets/flat-square/pending.svg: -------------------------------------------------------------------------------- 1 | vercel: pendingvercelpending -------------------------------------------------------------------------------- /assets/flat/error.svg: -------------------------------------------------------------------------------- 1 | vercel: api errorvercelapi error -------------------------------------------------------------------------------- /assets/flat/failed.svg: -------------------------------------------------------------------------------- 1 | vercel: failedvercelfailed -------------------------------------------------------------------------------- /assets/flat/none.svg: -------------------------------------------------------------------------------- 1 | vercel: nonevercelnone -------------------------------------------------------------------------------- /assets/flat/passing.svg: -------------------------------------------------------------------------------- 1 | vercel: passingvercelpassing -------------------------------------------------------------------------------- /assets/flat/pending.svg: -------------------------------------------------------------------------------- 1 | vercel: pendingvercelpending -------------------------------------------------------------------------------- /assets/for-the-badge/error.svg: -------------------------------------------------------------------------------- 1 | VERCEL: API ERRORVERCELAPI ERROR -------------------------------------------------------------------------------- /assets/for-the-badge/failed.svg: -------------------------------------------------------------------------------- 1 | VERCEL: FAILEDVERCELFAILED -------------------------------------------------------------------------------- /assets/for-the-badge/none.svg: -------------------------------------------------------------------------------- 1 | VERCEL: NONEVERCELNONE -------------------------------------------------------------------------------- /assets/for-the-badge/passing.svg: -------------------------------------------------------------------------------- 1 | VERCEL: PASSINGVERCELPASSING -------------------------------------------------------------------------------- /assets/for-the-badge/pending.svg: -------------------------------------------------------------------------------- 1 | VERCEL: PENDINGVERCELPENDING -------------------------------------------------------------------------------- /assets/plastic/error.svg: -------------------------------------------------------------------------------- 1 | vercel: api errorvercelapi error -------------------------------------------------------------------------------- /assets/plastic/failed.svg: -------------------------------------------------------------------------------- 1 | vercel: failedvercelfailed -------------------------------------------------------------------------------- /assets/plastic/none.svg: -------------------------------------------------------------------------------- 1 | vercel: nonevercelnone -------------------------------------------------------------------------------- /assets/plastic/passing.svg: -------------------------------------------------------------------------------- 1 | vercel: passingvercelpassing -------------------------------------------------------------------------------- /assets/plastic/pending.svg: -------------------------------------------------------------------------------- 1 | vercel: pendingvercelpending -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vercel-badge", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "vercel-badge", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^0.21.0" 13 | }, 14 | "devDependencies": { 15 | "@vercel/node": "^1.12.1" 16 | } 17 | }, 18 | "node_modules/@types/node": { 19 | "version": "17.0.13", 20 | "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.13.tgz", 21 | "integrity": "sha512-Y86MAxASe25hNzlDbsviXl8jQHb0RDvKt4c40ZJQ1Don0AAL0STLZSs4N+6gLEO55pedy7r2cLwS+ZDxPm/2Bw==", 22 | "dev": true 23 | }, 24 | "node_modules/@vercel/node": { 25 | "version": "1.12.1", 26 | "resolved": "https://registry.npmjs.org/@vercel/node/-/node-1.12.1.tgz", 27 | "integrity": "sha512-NcawIY05BvVkWlsowaxF2hl/hJg475U8JvT2FnGykFPMx31q1/FtqyTw/awSrKfOSRXR0InrbEIDIelmS9NzPA==", 28 | "dev": true, 29 | "dependencies": { 30 | "@types/node": "*", 31 | "ts-node": "8.9.1", 32 | "typescript": "4.3.4" 33 | } 34 | }, 35 | "node_modules/arg": { 36 | "version": "4.1.3", 37 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 38 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", 39 | "dev": true 40 | }, 41 | "node_modules/axios": { 42 | "version": "0.21.4", 43 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", 44 | "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", 45 | "dependencies": { 46 | "follow-redirects": "^1.14.0" 47 | } 48 | }, 49 | "node_modules/buffer-from": { 50 | "version": "1.1.2", 51 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 52 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", 53 | "dev": true 54 | }, 55 | "node_modules/diff": { 56 | "version": "4.0.2", 57 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 58 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 59 | "dev": true, 60 | "engines": { 61 | "node": ">=0.3.1" 62 | } 63 | }, 64 | "node_modules/follow-redirects": { 65 | "version": "1.14.7", 66 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", 67 | "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==", 68 | "funding": [ 69 | { 70 | "type": "individual", 71 | "url": "https://github.com/sponsors/RubenVerborgh" 72 | } 73 | ], 74 | "engines": { 75 | "node": ">=4.0" 76 | }, 77 | "peerDependenciesMeta": { 78 | "debug": { 79 | "optional": true 80 | } 81 | } 82 | }, 83 | "node_modules/make-error": { 84 | "version": "1.3.6", 85 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", 86 | "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", 87 | "dev": true 88 | }, 89 | "node_modules/source-map": { 90 | "version": "0.6.1", 91 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 92 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 93 | "dev": true, 94 | "engines": { 95 | "node": ">=0.10.0" 96 | } 97 | }, 98 | "node_modules/source-map-support": { 99 | "version": "0.5.21", 100 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", 101 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", 102 | "dev": true, 103 | "dependencies": { 104 | "buffer-from": "^1.0.0", 105 | "source-map": "^0.6.0" 106 | } 107 | }, 108 | "node_modules/ts-node": { 109 | "version": "8.9.1", 110 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.9.1.tgz", 111 | "integrity": "sha512-yrq6ODsxEFTLz0R3BX2myf0WBCSQh9A+py8PBo1dCzWIOcvisbyH6akNKqDHMgXePF2kir5mm5JXJTH3OUJYOQ==", 112 | "dev": true, 113 | "dependencies": { 114 | "arg": "^4.1.0", 115 | "diff": "^4.0.1", 116 | "make-error": "^1.1.1", 117 | "source-map-support": "^0.5.17", 118 | "yn": "3.1.1" 119 | }, 120 | "bin": { 121 | "ts-node": "dist/bin.js", 122 | "ts-node-script": "dist/bin-script.js", 123 | "ts-node-transpile-only": "dist/bin-transpile.js", 124 | "ts-script": "dist/bin-script-deprecated.js" 125 | }, 126 | "engines": { 127 | "node": ">=6.0.0" 128 | }, 129 | "peerDependencies": { 130 | "typescript": ">=2.7" 131 | } 132 | }, 133 | "node_modules/typescript": { 134 | "version": "4.3.4", 135 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.4.tgz", 136 | "integrity": "sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==", 137 | "dev": true, 138 | "bin": { 139 | "tsc": "bin/tsc", 140 | "tsserver": "bin/tsserver" 141 | }, 142 | "engines": { 143 | "node": ">=4.2.0" 144 | } 145 | }, 146 | "node_modules/yn": { 147 | "version": "3.1.1", 148 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 149 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 150 | "dev": true, 151 | "engines": { 152 | "node": ">=6" 153 | } 154 | } 155 | }, 156 | "dependencies": { 157 | "@types/node": { 158 | "version": "17.0.13", 159 | "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.13.tgz", 160 | "integrity": "sha512-Y86MAxASe25hNzlDbsviXl8jQHb0RDvKt4c40ZJQ1Don0AAL0STLZSs4N+6gLEO55pedy7r2cLwS+ZDxPm/2Bw==", 161 | "dev": true 162 | }, 163 | "@vercel/node": { 164 | "version": "1.12.1", 165 | "resolved": "https://registry.npmjs.org/@vercel/node/-/node-1.12.1.tgz", 166 | "integrity": "sha512-NcawIY05BvVkWlsowaxF2hl/hJg475U8JvT2FnGykFPMx31q1/FtqyTw/awSrKfOSRXR0InrbEIDIelmS9NzPA==", 167 | "dev": true, 168 | "requires": { 169 | "@types/node": "*", 170 | "ts-node": "8.9.1", 171 | "typescript": "4.3.4" 172 | } 173 | }, 174 | "arg": { 175 | "version": "4.1.3", 176 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 177 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", 178 | "dev": true 179 | }, 180 | "axios": { 181 | "version": "0.21.4", 182 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", 183 | "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", 184 | "requires": { 185 | "follow-redirects": "^1.14.0" 186 | } 187 | }, 188 | "buffer-from": { 189 | "version": "1.1.2", 190 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 191 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", 192 | "dev": true 193 | }, 194 | "diff": { 195 | "version": "4.0.2", 196 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 197 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 198 | "dev": true 199 | }, 200 | "follow-redirects": { 201 | "version": "1.14.7", 202 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", 203 | "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==" 204 | }, 205 | "make-error": { 206 | "version": "1.3.6", 207 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", 208 | "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", 209 | "dev": true 210 | }, 211 | "source-map": { 212 | "version": "0.6.1", 213 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 214 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 215 | "dev": true 216 | }, 217 | "source-map-support": { 218 | "version": "0.5.21", 219 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", 220 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", 221 | "dev": true, 222 | "requires": { 223 | "buffer-from": "^1.0.0", 224 | "source-map": "^0.6.0" 225 | } 226 | }, 227 | "ts-node": { 228 | "version": "8.9.1", 229 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.9.1.tgz", 230 | "integrity": "sha512-yrq6ODsxEFTLz0R3BX2myf0WBCSQh9A+py8PBo1dCzWIOcvisbyH6akNKqDHMgXePF2kir5mm5JXJTH3OUJYOQ==", 231 | "dev": true, 232 | "requires": { 233 | "arg": "^4.1.0", 234 | "diff": "^4.0.1", 235 | "make-error": "^1.1.1", 236 | "source-map-support": "^0.5.17", 237 | "yn": "3.1.1" 238 | } 239 | }, 240 | "typescript": { 241 | "version": "4.3.4", 242 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.4.tgz", 243 | "integrity": "sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==", 244 | "dev": true 245 | }, 246 | "yn": { 247 | "version": "3.1.1", 248 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 249 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 250 | "dev": true 251 | } 252 | } 253 | } 254 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vercel-badge", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^0.21.0" 13 | }, 14 | "devDependencies": { 15 | "@vercel/node": "^1.12.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "redirects": [ 3 | { "source": "/", "destination": "https://github.com/datejer/vercel-badge" } 4 | ], 5 | "functions": { 6 | "api/[owner]/[repo].ts": { 7 | "includeFiles": "assets/**" 8 | } 9 | } 10 | } 11 | --------------------------------------------------------------------------------