This commit is contained in:
Nathan Rashleigh committed 2024-04-10 17:22:43 +10:00
1 parent 396b288ea8
commit 763b225fc2
8 files changed
+561 -96

No files matched your search

+3 -2
View File
@@ -2,10 +2,11 @@ import type { PrismaClient, Attachment, Meme } from '@prisma/client';
import * as attachments from './attachments'
const STORAGE_BUCKET = process.env.STORAGE_BUCKET
function memeUrl(a: Attachment) {
const STORAGE_URL = process.env.STORAGE_URL
const path = attachments.objectName(a)
const u = new URL(path, `https://${STORAGE_URL}`)
const u = new URL(`${STORAGE_BUCKET}/${attachments.objectName(a)}`, `https://${STORAGE_URL}`)
return u.href
}