adds aws demo

This commit is contained in:
Tomasz Dłuski
2020-08-23 22:28:42 +02:00
parent 0f002cf097
commit c56c0fd2f0
10 changed files with 246 additions and 35 deletions

19
test-upload.js Normal file
View File

@@ -0,0 +1,19 @@
const fs = require('fs')
const path = require('path')
const uploadFile = require('./aws')
const testUpload = () => {
const filePath = path.resolve(__dirname, 'test_upload.webp')
const fileStream = fs.createReadStream(filePath)
const now = new Date()
const fileName = `test-image-${now.toISOString()}.jpg`
uploadFile(fileStream, fileName).then((response) => {
console.log(":)")
console.log(response)
}).catch((err) => {
console.log(":|")
console.log(err)
})
}
testUpload()