我有一个node.js RESTful API,它使用Apache CouchDB作为NoSQL数据库。我是Heroku的新手,刚刚将我的API部署到了Heroku实例。但是,启动失败,因为它无法连接到CouchDB。我已经研究过如何在Heroku上设置CouchDB但是没有发现任何有效的东西。
我找到了这个buildpack但它不再存在:https://elements.heroku.com/buildpacks/aindeev/heroku-buildpack-couchdb
我发现这个堆栈溢出帖子,但似乎没有提供解决方案:Host couchdb on heroku
有人可以帮我提供一些关于如何在heroku上托管couchdb的说明吗?
如果您正在创建应用程序,则可以执行以下操作
heroku create --buildpack https://github.com/creativegeekjp/heroku-buildpack-couchdb.git
从而创建安装了couchdb buildpack的应用程序。
但是,如果您已经拥有该应用程序,您可以做的是
heroku config:add BUILDPACK_URL="https://github.com/creativegeekjp/heroku-buildpack-couchdb.git" -a YOUR_APP
-a YOUR_APP是可选的,考虑到你可能在添加buildpack时已经初始化为heroku应用程序的文件夹中,你可能不需要它。
或者更容易
heroku buildpacks:set https://github.com/creativegeekjp/heroku-buildpack-couchdb.git
之后你必须跑
git push heroku master
部署你的buildpack