a year ago
I have an express application that uploads images to an /uploads folder in my express application.
Ies it correct to mount a volume to /uploads in order to have persistent storage of the images in that folder?
11 Replies
a year ago
please see our docs on this topic -
Is there a way to check the contents of the volume so that I know something has been uploaded there ? New to railway and trying to see if it makes sense on a client project 🙂
My code generates urls like such: https://exarbete-production.up.railway.app/uploads/eventImage-1731874140525-205047834.jpg
just trying to figure out if this has actually ended up in persistent storage or not 😄
or does this backend code need to reflect the app/uploads bit? i feel like the documentation isn't super clear, or I might not understand it fully 😄
const uploadsDir = path.join(process.cwd(), "/uploads");
if (!fs.existsSync(uploadsDir)) {
fs.mkdirSync(uploadsDir, { recursive: true });
}`
a year ago
most likely
a year ago
check the volume metrics
a year ago
backend code should not use /app
Yeah solved it eventually, the issue i was facing was that the images I was uploading was so small that the metrics didn't seem to detect them being uploaded. Uploaded some bigger ones and got some reaction 🙂
a year ago
awsome