susee
This commit is contained in:
parent
64e4a5f661
commit
ec8ed85210
@ -1142,3 +1142,20 @@ const storage = new Storage({ keyFilename : path.join(__dirname, "../../googleCl
|
|||||||
} //end of try catch
|
} //end of try catch
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.test = async (req, res) => {
|
||||||
|
const storage = new Storage({ keyFilename : path.join(__dirname, "../../googleCloud.json") });
|
||||||
|
bucketName = 'pd-giene-data';
|
||||||
|
const bucket = storage.bucket(bucketName);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const [files] = await bucket.getFiles();
|
||||||
|
|
||||||
|
const fileNames = files.map((file) => file.name);
|
||||||
|
console.log('File names:', fileNames);
|
||||||
|
res.send({'data':fileNames})
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error retrieving file names:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ module.exports = app => {
|
|||||||
* description: success
|
* description: success
|
||||||
*/
|
*/
|
||||||
router.get("/demo", Mycontroller.Welcome);
|
router.get("/demo", Mycontroller.Welcome);
|
||||||
|
router.get("/test", SalesPdController.test);
|
||||||
// landing page api
|
// landing page api
|
||||||
/**
|
/**
|
||||||
* @swagger
|
* @swagger
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user