@@ -14,17 +14,17 @@ function getMinMax(value = '1') {
1414 return value . split ( '-' ) ;
1515}
1616
17- function getCodeAsSVG ( path , range = '1' ) {
17+ function getCodeAsSVG ( path , range = '1' , lang = null ) {
1818 const url = githubRawUrl + path ;
1919 return request ( { uri : url } ) . then ( ( code ) => {
2020 const [ min , max ] = getMinMax ( range ) ;
21- return codeToSVG ( code , min , max ) ;
21+ return codeToSVG ( code , min , max , lang ) ;
2222 } ) ;
2323}
2424
2525exports . test = functions . https . onRequest ( ( req , res ) => {
2626 const path = '/GrabarzUndPartner/gp-vue-boilerplate/master/src/components/molecules/LinkList.vue' ;
27- getCodeAsSVG ( path , req . query . L ) . then ( ( svg ) => {
27+ getCodeAsSVG ( path , req . query . range , req . query . lang ) . then ( ( svg ) => {
2828 res . setHeader ( 'Content-Type' , 'image/svg+xml' ) ;
2929 res . setHeader ( 'Cache-Control' , 'no-cache' ) ;
3030 res . send ( Buffer . from ( svg ) ) ;
@@ -33,7 +33,7 @@ exports.test = functions.https.onRequest((req, res) => {
3333
3434app . get ( [ '/:foo/:bar/*' ] , ( req , res ) => {
3535 const path = req . path . replace ( / ( [ \w - ] * \/ [ \w - ] * ) ( \/ b l o b ) / , '$1' ) ;
36- getCodeAsSVG ( path , req . query . L ) . then ( ( svg ) => {
36+ getCodeAsSVG ( path , req . query . range , req . query . lang ) . then ( ( svg ) => {
3737 res . setHeader ( 'Content-Type' , 'image/svg+xml' ) ;
3838 res . setHeader ( 'Cache-Control' , 'no-cache' ) ;
3939 res . send ( Buffer . from ( svg ) ) ;
0 commit comments