WiP CORS Issue.

This commit is contained in:
Naida Vatric
2020-02-16 01:06:53 +01:00
parent cbb3c1f954
commit 57df42dd05
4 changed files with 34 additions and 18 deletions

View File

@@ -55,8 +55,15 @@ setInterval(crawl, CRAWLER_INTERVAL * 1000);
setInterval(checkUpNotify, 1000 * 60 * 60 * 24);
//Google storage req
const storage = new Storage();
const BUCKET_NAME = "kivi_original_photos";
const PROJECT_ID = "marketalarm";
const KEY_FILENAME = "marketalarm-262e746e533c.json"; //relative path
const BUCKET_NAME = "marketalarm-photos";
const storage = new Storage({
projectId: PROJECT_ID,
keyFilename: KEY_FILENAME
});
const bucket = storage.bucket(BUCKET_NAME);
/*
async function generateSignedUrl() {
@@ -79,11 +86,12 @@ app.get("/generateSignedURL", (req, res) => {
console.log("Started server function!");
const options = {
GoogleAccessID:
" kivi-original-photos-id@marketalarm.iam.gserviceaccount.com",
PrivateKey: "dd909e0aeef15920e7fc18229ce421246c143f90",
version: "v4",
// GoogleAccessID:
// " kivi-original-photos-id@marketalarm.iam.gserviceaccount.com",
// PrivateKey: "dd909e0aeef15920e7fc18229ce421246c143f90",
version: "v2",
action: "write",
contentType: "image/*",
expires: Date.now() + 86400000
};
const filename = req.query.filename;