Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 566a552

Browse files
chore(ci): update and deploy firebase function for code.angularjs.org
1 parent 3c75a89 commit 566a552

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

scripts/code.angularjs.org-firebase/functions/index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use strict';
22

33
const functions = require('firebase-functions');
4-
const gcs = require('@google-cloud/storage')();
4+
const {Storage} = require('@google-cloud/storage');
55
const path = require('path');
66

7+
const storage = new Storage();
78
const gcsBucketId = `${process.env.GCLOUD_PROJECT}.appspot.com`;
89

910
const 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

scripts/code.angularjs.org-firebase/functions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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",

0 commit comments

Comments
 (0)