snapshot of https://github.com/raimohanska/ourboard.git (master, 2026-09-23; blobs > 131072B omitted)
Some checks failed
build / test (18.x) (push) Failing after 10s
build / lint (18.x) (push) Failing after 0s
build / docker-image (push) Has been skipped

This commit is contained in:
upstream-mirror
2026-09-23 16:16:17 +05:00
commit d57328655f
233 changed files with 21282 additions and 0 deletions

26
backend/src/s3.ts Normal file
View File

@@ -0,0 +1,26 @@
import * as AWS from "aws-sdk"
const s3Config = {
region: "eu-north-1",
apiVersion: "2006-03-01",
signatureVersion: "v4",
}
let s3Instance: AWS.S3 | null = null
export const s3 = () => {
s3Instance = s3Instance || new AWS.S3(s3Config)
return s3Instance
}
export function getSignedPutUrl(Key: string) {
const signedUrlExpireSeconds = 60 * 5
const url = s3().getSignedUrl("putObject", {
Bucket: "r-board-assets",
Key,
Expires: signedUrlExpireSeconds,
})
return url
}