Move github examples into services/github (#2309)

This commit is contained in:
Paul Melnikow
2018-11-15 15:57:56 -05:00
committed by GitHub
parent 5d63effabc
commit fe05d00747
22 changed files with 667 additions and 319 deletions

View File

@@ -7,10 +7,32 @@ const {
makeLogo: getLogo,
} = require('../../lib/badge-data')
const {
documentation,
checkErrorResponse: githubCheckErrorResponse,
} = require('./github-helpers')
module.exports = class GithubSize extends LegacyService {
static get category() {
return 'size'
}
static get route() {
return {
base: 'github/size',
}
}
static get examples() {
return [
{
title: 'GitHub repo size in bytes',
previewUrl: 'webcaetano/craft/build/phaser-craft.min.js',
keywords: ['GitHub', 'file', 'size'],
documentation,
},
]
}
static registerLegacyRouteHandler({ camp, cache, githubApiProvider }) {
camp.route(
/^\/github\/size\/([^/]+)\/([^/]+)\/(.*)\.(svg|png|gif|jpg|json)$/,