【发布时间】:2016-09-05 04:01:56
【问题描述】:
我正在尝试使用 thinky.io
连接到 compose.io 上托管的 rethinkDB 服务器根据文档,我可以使用 r.connect 连接以下内容:
const r = require('rethinkdb');
const fs = require('fs');
fs.readFile('../cacert', function(err, caCert) {
r.connect({
authKey: 'MY_KEY',
host: 'aws-us-east-1-portal.5.dblayer.com',
port: 11190,
ssl: {
ca: caCert
}
}, function(error, conn) {
r.dbList().run(conn, function(err, results) {
console.log(results);
})
})
});
但是,当使用 thinky.io 时,它不需要 SSL 证书,我会使用以下不起作用的方法进行连接:
const thinky = require('thinky')({
authKey: 'MY_KEY',
host: 'aws-us-east-1-portal.5.dblayer.com',
port: 11190,
});
我有什么方法可以连接到使用 thinky.io或连接到 r.connect(),然后将现有连接与 thinky.io 一起使用?
我的 node.js 服务器托管在 heroku 上。
谢谢
【问题讨论】:
标签: javascript node.js rethinkdb compose-db thinky