This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const contentDisposition = 'attachment; filename=\"' + process.env.AWS_BUCKET_BASE_FOLDER + '\\' + req.params.key + '\"'; | |
let params = { | |
Bucket: process.env.AWS_BUCKET, | |
Key: process.env.AWS_BUCKET_BASE_FOLDER + '/' + req.params.key, | |
ResponseContentDisposition: contentDisposition, | |
Expires: 10 | |
}; | |
s3Client.config.region = process.env.AWS_REGION; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let params = { | |
Bucket: process.env.AWS_BUCKET, | |
Key: process.env.AWS_BUCKET_BASE_FOLDER + '/' + req.body.params.fileName, | |
MultipartUpload: { Parts: req.body.params.parts }, | |
UploadId: req.body.params.uploadId | |
}; | |
return new Promise( | |
(resolve, reject) => s3Client.completeMultipartUpload(params, async (err, data) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const s3Client = s3.s3Client; | |
let params = { | |
Bucket: process.env.AWS_BUCKET, | |
Key: process.env.AWS_BUCKET_BASE_FOLDER + '/' + req.query.fileName, | |
PartNumber: req.query.partNumber, | |
UploadId: req.query.uploadId, | |
Expires: 10000 | |
}; | |
return new Promise( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.get('/start', async (req, res) => { | |
const s3Client = s3.s3Client; | |
let params = { | |
Bucket: process.env.AWS_BUCKET, | |
Key: process.env.AWS_BUCKET_BASE_FOLDER + '/' + req.query.fileName, | |
ContentType: req.query.fileType | |
}; | |
return new Promise( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.get('/start', async (req, res) => { | |
try { | |
const s3Client = s3.s3Client; | |
let params = { | |
Bucket: process.env.AWS_BUCKET, | |
Key: process.env.AWS_BUCKET_BASE_FOLDER + '/' + req.query.fileName, | |
ContentType: req.query.fileType | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var singleton2 = require('./Singleton'); | |
function prnt() { | |
return singleton2.printTime(); | |
} | |
module.exports = { prnt }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ins1 = require('./instance'); | |
const ins2 = require('./instance2'); | |
console.log('ins1: ',ins1.prnt()); | |
setTimeout(() => console.log('ins2: ',ins2.prnt2()), 2000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var singleton2 = require('./singleton'); | |
function prnt2() { | |
return singleton2.printTime(); | |
} | |
module.exports = { prnt2 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var singleton1 = require('./singleton'); | |
function prnt() { | |
return singleton1.printTime(); | |
} | |
module.exports = { prnt }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Singleton { | |
constructor() { | |
this.date = new Date().getTime(); | |
} | |
printTime(){ | |
return this.date; | |
} | |
} |
NewerOlder