How can i use json database in express server

I want to use json database on my web server but when i restart my server its removing my json file.How can i storage my json data

Hi,

You’ll need to attach a Disk to save files to your service.

Please note that Free Web Services do not support persistent disks. You can upgrade your service from the settings page.

Let me know if you have any additional questions about this.

i attached but theres only snaphots to save,do i have to restore every time?

Hello,

Can you show me a snippet of code where you’re saving the JSON file?

Regards,

Matt


its store on same place with server.js,directy in disk not in folder

Hi sli,

You’ll need to save it to the path where your disk is mounted, and not in the project’s root directory.

Regards,

Matt

thank you its worked,can i easily open and edit json on render dashboard?

Hi sli,

The closest thing to that would be using a shell (requires a paid instance type) and making edits there using a terminal text editor.

Regards,

Matt