如何设置Apache CouchDB在Heroku上运行?

use*_*544 6 couchdb heroku node.js

我有一个使用Apache CouchDB作为NoSQL数据库的node.js RESTful API。我是Heroku的新手,只是将我的API部署到Heroku实例。但是,启动失败,因为它无法连接到CouchDB。我研究了如何在Heroku上设置CouchDB,但没有找到任何有效的方法。

我找到了这个buildpack,但是它已经不存在了:https : //elements.heroku.com/buildpacks/aindeev/heroku-buildpack-couchdb

我发现了此堆栈溢出后的帖子,但似乎没有提供解决方案:heroku上的host couchdb

有人可以帮我提供一些有关如何在heroku上托管Couchdb的指示吗?

use*_*694 2

如果您正在创建应用程序,您可以执行以下操作

heroku create --buildpack https://github.com/creativegeekjp/heroku-buildpack-couchdb.git
Run Code Online (Sandbox Code Playgroud)

从而创建安装了 couchdb buildpack 的应用程序。

但是,如果您已经拥有该应用程序,您可以做的是

heroku config:add BUILDPACK_URL="https://github.com/creativegeekjp/heroku-buildpack-couchdb.git" -a YOUR_APP
Run Code Online (Sandbox Code Playgroud)

-a YOUR_APP 是可选的,考虑到您在添加构建包时可能位于已初始化为 heroku 应用程序的文件夹中,您可能不需要它。

或者更容易

heroku buildpacks:set https://github.com/creativegeekjp/heroku-buildpack-couchdb.git
Run Code Online (Sandbox Code Playgroud)

之后你必须跑

git push heroku master
Run Code Online (Sandbox Code Playgroud)

部署您的构建包