-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How it works.. #811
Labels
documentation
Developer and end-user documentation
Comments
Server is implemented with Camp.js, which takes a series of route callbacks that look like: // Travis integration
camp.route(/^\/travis(-ci)?\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var userRepo = match[2]; // eg, espadrine/sc
var branch = match[3];
var format = match[4];
var options = {
method: 'HEAD',
uri: 'https://api.travis-ci.org/' + userRepo + '.svg',
};
... |
The // data (URL query) can include `label`, `style`, `logo`, `logoWidth`, `link`.
// It can also include `maxAge`.
function getBadgeData(defaultLabel, data) {
var label = getLabel(defaultLabel, data);
var template = data.style || 'default';
... |
Finally I found a place where |
paulmelnikow
added
developer-experience
Dev tooling, test framework, and CI
and removed
docs
labels
Apr 17, 2017
Closed
paulmelnikow
added
documentation
Developer and end-user documentation
and removed
core
Server, BaseService, GitHub auth, Shared helpers
developer-experience
Dev tooling, test framework, and CI
labels
Nov 6, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I guess that badges are compiled dynamically on each request and then cached, but how it works in detail?
Assuming the auditory is somebody who wants to tackle #507 without much knowledge of JavaScript and supporting infrastructure.
For the start, https://img.shields.io/ runs a web server. Root request redirects to a https://shields.io/ domain with human instructions. Any other request to https://img.shields.io/ subpaths is handled by ? ... ? which parses URL parameters, ?checks status?, creates SVG and caches it.
How SVG is created?
The text was updated successfully, but these errors were encountered: