diff --git a/server.js b/server.js index e2af1eb6f9c10..eb5dda4ac932e 100644 --- a/server.js +++ b/server.js @@ -4479,16 +4479,16 @@ cache(function(data, match, sendBadge, request) { // CircleCI build integration. // https://circleci.com/api/v1/project/BrightFlair/PHP.Gt?circle-token=0a5143728784b263d9f0238b8d595522689b3af2&limit=1&filter=completed -camp.route(/^\/circleci\/(?:token\/(\w+))?[+\/]?project\/(github|bitbucket)\/([^\/]+\/[^\/]+)(?:\/(.*))?\.(svg|png|gif|jpg|json)$/, +camp.route(/^\/circleci\/(?:token\/(\w+))?[+\/]?project\/(github|bitbucket)?[+\/]?([^\/]+\/[^\/]+)(?:\/(.*))?\.(svg|png|gif|jpg|json)$/, cache(function(data, match, sendBadge, request) { var token = match[1]; - var type = match[2]; // github OR bitbucket + var type = match[2] || 'github'; // github OR bitbucket var userRepo = match[3]; // eg, `RedSparr0w/node-csgo-parser`. var branch = match[4] var format = match[5]; // Base API URL - var apiUrl = 'https://circleci.com/api/v1.1/project/'+ type +"/"+ userRepo; + var apiUrl = 'https://circleci.com/api/v1.1/project/' + type + '/' + userRepo; // Query Params queryParams = {}; diff --git a/try.html b/try.html index 473a2323a16f5..a4262b2d57d2a 100644 --- a/try.html +++ b/try.html @@ -117,15 +117,15 @@
https://img.shields.io/magnumci/ci/96ffb83fa700f069024921b0702e76ff/new-meta.svg
https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg
https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser/master.svg
https://img.shields.io/circleci/token/YOURTOKEN/project/github/RedSparr0w/node-csgo-parser/master.svg