Skip to content

Instantly share code, notes, and snippets.

@yann-yinn
Last active November 28, 2019 10:00
Show Gist options
  • Save yann-yinn/baa98e42b8456d02a55cac49d7a23365 to your computer and use it in GitHub Desktop.
Save yann-yinn/baa98e42b8456d02a55cac49d7a23365 to your computer and use it in GitHub Desktop.
var AWS = require("aws-sdk");
var credentials = {
accessKeyId: process.env.AWS_ACCESS_KEY,
secretAccessKey: process.env.AWS_SECRET_KEY
};
AWS.config.update({
credentials: credentials,
region: process.env.AWS_S3_REGION
});
module.exports = new AWS.S3({ signatureVersion: "v4" });
const S3 = require("@src/utils/awsS3");
const presigneUrl = S3.getSignedUrl("putObject", {
Bucket: "fireblog.dev",
Key: filename
//Expires: parseInt(process.env.AWS_S3_PRESIGNED_URL_UPLOAD_EXPIRES_SECONDS)
});
console.log("presignedUrl", presigneUrl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment