events and gallery backend fix

This commit is contained in:
2025-12-09 19:25:17 +01:00
parent 5d0c0a0b17
commit 901223fcd9
11 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ const eventsRoute: FastifyPluginAsync = async (fastify) => {
// Prepare directories - use persistent volume for Fly.io
const dataDir = process.env.GIT_WORKSPACE_DIR || path.join(process.cwd(), 'data');
const uploadDir = path.join(dataDir, 'images', 'events');
const uploadDir = path.join(dataDir, 'public', 'images', 'events');
if (!fs.existsSync(uploadDir)) fs.mkdirSync(uploadDir, { recursive: true });
// Read uploaded stream into buffer
@@ -133,7 +133,7 @@ const eventsRoute: FastifyPluginAsync = async (fastify) => {
fs.writeFileSync(destPath, outBuffer);
// Public URL (served via /static)
const publicUrl = `/static/images/events/${filename}`;
const publicUrl = `/images/events/${filename}`;
return reply.code(201).send({ imageUrl: publicUrl });