Skip to content

Commit 1e290f5

Browse files
committed
Move bucket to env var
1 parent ce1dc50 commit 1e290f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import express = require('express');
77
import httpProxy = require('http-proxy');
88

99
const URL = 'https://storage.googleapis.com';
10+
const BUCKET = `${process.env.GOOGLE_CLOUD_PROJECT}.appspot.com`;
1011
const datastore = new Datastore();
1112
const auth = new GoogleAuth({
1213
scopes: 'https://www.googleapis.com/auth/devstorage.read_only',
@@ -101,7 +102,7 @@ export function createApp(siteId: string, branchOrRef: string) {
101102

102103
const manifestPaths = manifest.paths;
103104
const blobKey = manifestPaths[blobPath];
104-
const updatedUrl = `/${process.env.GOOGLE_CLOUD_PROJECT}.appspot.com/fileset/sites/${requestSiteId}/blobs/${blobKey}`;
105+
const updatedUrl = `/${BUCKET}/fileset/sites/${requestSiteId}/blobs/${blobKey}`;
105106

106107
// TODO: Add custom 404 support based on site config.
107108
if (!blobKey) {

0 commit comments

Comments
 (0)