2017-08-26 41 views
0

這個Meteor服務器代碼在各個地方被調用,我的本地開發服務器上運行的代碼將文件保存到硬盤驅動器。
但現在它在AWS EC2 Docker容器上運行,我該如何將文件寫入S3存儲桶? thx從在EC2上docker上運行的代碼寫入S3存儲桶

'saveToFile': function (fileName, text) { 
    if (env != 'development') return; 
    const playPath = '/Users/localPath/' + fileName + '.html'; 
    fs.writeFile(playPath, text, (err) => { 
    if (err) throw err; 
    console.log(`Saved to ` + fileName); 
    }); 
} 

回答