Skip to content

Commit 41de989

Browse files
fix(cleanup): rearranged code blocks
1 parent 05d0240 commit 41de989

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

functions/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ function getCodeAsSVG(path, range = '1', lang = null) {
2222
});
2323
}
2424

25-
exports.test = functions.https.onRequest((req, res) => {
26-
const path = '/GrabarzUndPartner/gp-vue-boilerplate/master/src/components/molecules/LinkList.vue';
25+
app.get(['/:account/:repo/*'], (req, res) => {
26+
const path = req.path.replace(/([\w-]*\/[\w-]*)(\/blob)/, '$1');
2727
getCodeAsSVG(path, req.query.range, req.query.lang).then((svg) => {
2828
res.setHeader('Content-Type', 'image/svg+xml');
2929
res.send(Buffer.from(svg));
3030
});
3131
});
3232

33-
app.get(['/:foo/:bar/*'], (req, res) => {
34-
const path = req.path.replace(/([\w-]*\/[\w-]*)(\/blob)/, '$1');
33+
exports.default = functions.https.onRequest(app);
34+
35+
exports.test = functions.https.onRequest((req, res) => {
36+
const path = '/GrabarzUndPartner/gp-vue-boilerplate/master/src/components/molecules/LinkList.vue';
3537
getCodeAsSVG(path, req.query.range, req.query.lang).then((svg) => {
3638
res.setHeader('Content-Type', 'image/svg+xml');
3739
res.send(Buffer.from(svg));
3840
});
3941
});
40-
41-
exports.default = functions.https.onRequest(app);

0 commit comments

Comments
 (0)