Started photo upload.
This commit is contained in:
29
index.js
29
index.js
@@ -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}`)
|
||||
}
|
||||
}) */
|
||||
|
||||
Reference in New Issue
Block a user