我的文件/图像存储在 Azure 存储中,但我需要通过流发送文件(而不是在本地下载文件)
import storage from 'azure-storage';
const Storage = storage.createBlobService();
async handler(request,h){
const photo = new Promise((resolve, reject) => {
const res = Storage.createReadStream('conatinername',
'file.jpg');
res.on('data', () => { });
res.on('readable', (data) => resolve(data));
});
return await photo;
}