Started photo upload.

This commit is contained in:
Naida Vatric
2020-02-13 17:08:49 +01:00
parent 9bcadffe9c
commit 230ef60158
8 changed files with 713 additions and 810 deletions

View File

@@ -5,9 +5,9 @@ const layout = require("express-layout");
const compression = require("compression");
const forceSSL = require("./app/helpers/forceSSL");
const { Storage } = require("@google-cloud/storage");
const validate = require("validate.js");
const {
APP_PORT,
CRAWLER_INTERVAL,
@@ -53,3 +53,30 @@ const crawl = () => {
setInterval(crawl, CRAWLER_INTERVAL * 1000);
setInterval(checkUpNotify, 1000 * 60 * 60 * 24);
//Google storage req
const storage = new Storage();
storage
.getBuckets()
.then(results => {
const buckets = results[0];
console.log("Buckets:");
buckets.forEach(bucket => {
console.log(bucket.name);
});
})
.catch(err => {
console.error("GOOGLE ERROR:", err);
});
/*
bucket = gcs.bucket('aBucket')
bucket.file('aFile').getSignedUrl({
action: 'write',
expires: moment.utc().add(1, 'days').format(),
}, (error, signedUrl) => {
if (error == null) {
console.log(`Signed URL is ${signedUrl}`)
}
}) */