This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
scripts/code.angularjs.org-firebase/functions Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33const functions = require ( 'firebase-functions' ) ;
4- const gcs = require ( '@google-cloud/storage' ) ( ) ;
4+ const { Storage } = require ( '@google-cloud/storage' ) ;
55const path = require ( 'path' ) ;
66
7+ const storage = new Storage ( ) ;
78const gcsBucketId = `${ process . env . GCLOUD_PROJECT } .appspot.com` ;
89
910const BROWSER_CACHE_DURATION = 60 * 10 ;
@@ -23,7 +24,7 @@ function sendStoredFile(request, response) {
2324 const version = filePathSegments [ 0 ] ;
2425 const isDocsPath = filePathSegments [ 1 ] === 'docs' ;
2526 const lastSegment = filePathSegments [ filePathSegments . length - 1 ] ;
26- const bucket = gcs . bucket ( gcsBucketId ) ;
27+ const bucket = storage . bucket ( gcsBucketId ) ;
2728
2829 let downloadSource ;
2930 let fileName ;
@@ -204,7 +205,7 @@ function deleteOldSnapshotZip(object, context) {
204205 const filePath = object . name ;
205206 const contentType = object . contentType ;
206207
207- const bucket = gcs . bucket ( bucketId ) ;
208+ const bucket = storage . bucket ( bucketId ) ;
208209
209210 const snapshotFolderMatch = filePath . match ( snapshotRegex ) ;
210211
Original file line number Diff line number Diff line change 22 "name" : " functions-firebase-code.angularjs.org" ,
33 "description" : " Cloud Functions to serve files from gcs to code.angularjs.org" ,
44 "engines" : {
5- "node" : " 8 "
5+ "node" : " 10 "
66 },
77 "dependencies" : {
88 "@google-cloud/storage" : " ^4.7.0" ,
You can’t perform that action at this time.
0 commit comments