Skip to content

Commit

Permalink
removed unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
stevem-zhou committed May 18, 2024
1 parent 5e88878 commit 951d6f9
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions packages/functions/src/routes/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,10 @@ uploadRouter.post("/image", async (req, res) => {

s3Client.send(uploadCommand);

const getCommand = new GetObjectCommand({
Bucket: Bucket.bucket.bucketName,
Key: key,
ContentType: type,
});

// const url = await getSignedUrl(s3Client, getCommand, { expiresIn: 3600 });
const url = `https://${Bucket.bucket.bucketName}.s3.amazonaws.com/${key}`;

res.setHeader("Content-Type", type);
res.setHeader("Access-Control-Allow-Origin", "*");
// 'headers': {
// 'access-control-allow-headers': 'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token',
// 'access-control-allow-methods': 'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT',
// 'access-control-allow-origin': '*'
// }
res.status(200).send({ url });
});

Expand Down

0 comments on commit 951d6f9

Please sign in to comment.