WiP CORS Issue.
This commit is contained in:
20
index.js
20
index.js
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user