A.Samad Salaat
A.Samad Salaat

Reputation: 73

Read file from deployed server on heroku

I have a server deployed on Heroku through Heroku auto deployment method from GitHub. On that server I have a file named subscription.json which contains user data whenever user is registered. I want to see that file.

How can I access that file?

Upvotes: 0

Views: 184

Answers (1)

Chris
Chris

Reputation: 136967

If that file is in your repository you should be able to read it like any regular file.

However, this isn't going to work on Heroku:

which contains user data whenever user is registered

Heroku's filesystem is dyno-local and ephemeral. Any changes you make to it will be lost the next time your dyno restarts. This happens frequently (at least once per day).

For saving things like user uploads, Heroku recommends using a third-party service like Amazon S3. But in this case I think a database would be a much more appropriate solution.

Heroku has its own PostgreSQL service that is very well supported and available out of the box. If you prefer to use another database there are plenty of options.

Upvotes: 1

Related Questions