Accessing disk storage from Nestjs/Node.js server

Hi. I’m a little bit confused with how to access photos that I store using my backend app. I have a node.js backend and I’m trying to access a folder I created via “Disk” path. Initially, I created that photos folder outside the src folder that stores my app, but anytime I’m acutally trying to access that I’m getting 403 Forbidden.

Having the “photos” folder inside the src folder doesn’t make sense, as to my understanding on every deploy, the src is deleted and then redeployed. What am I missing?

Hi there,

I recommend checking out our documentation on persistent disks: https://docs.render.com/disks. There are some good examples of how to properly utilize this feature (e.g. /var/data as the mount path).

Let us know if you have any further questions.

Regards,
Mike


Render Support Engineer, MT (UTC-7)

It seems I was creating my path in a wrong way. I thought I’m providing an absolute path, but a little “./” got in front of it inside the configuration for path creation. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.