MCPcopy Create free account
hub / github.com/SoftwareEngineeringDaily/software-engineering-daily-api / getS3Config

Function getS3Config

server/helpers/s3.js:5–18  ·  view source on GitHub ↗
(S3_BUCKET, fileType, fileName)

Source from the content-addressed store, hash-verified

3require('dotenv').config();
4
5function getS3Config(S3_BUCKET, fileType, fileName) {
6 // We should Make this options a helper method:
7 aws.config.region = 'us-west-2';
8 // const fileName = 'record-red-bg-180-2.png'; // This can be anything
9 // const fileType = 'image/png'; // req.query['file-type'];
10 const s3Params = {
11 Bucket: S3_BUCKET,
12 Key: fileName,
13 Expires: 60, // in seconds
14 ContentType: fileType,
15 ACL: 'public-read'
16 };
17 return s3Params;
18}
19
20function signS3(S3_BUCKET, fileType, newFileName, cbSuccess, cbError) {
21 // Probably only need to do this once:

Callers 1

signS3Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected