Samay Jain
Samay Jain

Reputation: 265

File read/write on cloud(heroku) using node.js

First of all I am a beginner with node.js. In node.js when I use functions such as fs.writeFile(); the file is created and is visible in my repository. But when this same process is done on a cloud such as heroku no file is visible in the repository(cloned via git). I know the file is being made because I am able to read it but I cannot view it. Why is this??? Plus how can I view the file?

Upvotes: 1

Views: 1112

Answers (1)

MartianMartian
MartianMartian

Reputation: 1849

I had the same issue, and found out that Heroku and other cloud services generally prefer that you don't write in their file system; everything you write/save will be store in "ephemeral filesystem", it's like a ghost file system really.

Usually you would want to use Amazon S3 or reddis for json files etc, and other bigger ones like mp3.

I think it will work if you rent a remote server, like ECS, with a linux system, and a mounted storage space, then this might work.

Upvotes: 3

Related Questions