admin管理员组文章数量:1339483
I have created a node app with local persistent storage in a .json file. It works fine running locally, but when I deploy it to heroku the persistent storage is modified, but then erased.
I have created a node app with local persistent storage in a .json file. It works fine running locally, but when I deploy it to heroku the persistent storage is modified, but then erased.
Share Improve this question edited Mar 14, 2017 at 0:04 Someone asked Mar 13, 2017 at 23:44 SomeoneSomeone 8722 gold badges8 silver badges27 bronze badges 1- What kind of local persistence? If you mean on the server then yes. That's how Heroku works, you need to install an addin – Paul Commented Mar 13, 2017 at 23:47
2 Answers
Reset to default 13Heroku does not provide any sort of persistent storage on dynos. If you need to persist files across sessions, you must use object storage such as Amazon S3.
https://devcenter.heroku./articles/dynos#ephemeral-filesystem
You can also setup Active Storage using Amazon S3 as @Max Woolf's explanation stated, but you can also store in a persistent instance of a relational database like postgres or Amazon RDS, which would be available on heroku as a plugin instead of using a json file.
本文标签: javascriptHeroku local persistent storageStack Overflow
版权声明:本文标题:javascript - Heroku local persistent storage - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743583033a2506013.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论