We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use reql embed quries with horizon
horizon_server._reql_conn.read().then((reql_conn) => { ^
const express = require('express'); const https = require('https'); const path = require('path'); const fs = require('fs'); const horizon = require('@horizon/server'); const r = horizon.r; const app = express(); // Serve our static stuff like css app.use(express.static(path.join(__dirname, 'dist'))); // Send all requests to index.html app.get('*', function (req, res) { res.sendFile(path.join(__dirname, 'dist', 'index.html')); }); const options = { key: fs.readFileSync(path.resolve(__dirname, './horizon-key.pem')), cert: fs.readFileSync(path.resolve(__dirname, './horizon-cert.pem')), }; const PORT = 8181; const server = https.createServer(options, app); server.listen(PORT, function() { console.log('Express server running at localhost:' + PORT); }); const horizon_options = { project_name: 'react_horizon', permissions: false, auth: { token_secret: 'sd', allow_anonymous: true, allow_unauthenticated: true, } }; const horizon_server = horizon(server, horizon_options); //error horizon_server._reql_conn.read().then((reql_conn) => { var doc = r.db('react_horizon').table('views').get(2).run(reql_conn.connection()); console.log(doc) });
The text was updated successfully, but these errors were encountered:
Hey, something like that wouldn't work?
const connection = horizon_server._reql_conn.connection(); horizon.r.db('database').table('..').customQuery.run(connection);
Sorry, something went wrong.
@jirikolarik Not quite
Error: Connection to the database is down.
@githubitsme Try _ready_promise instead of read().
_ready_promise
read()
horizonServer._reql_conn._ready_promise.then((reql_conn) => {
I got it working like this:
horizonServer._reql_conn.ready().then(() => { // eslint-disable-line no-underscore-dangle const conn = horizonServer._reql_conn.connection(); horizon.r.db('database').table('..').customQuery.run(connection); });
No branches or pull requests
How to use reql embed quries with horizon
The text was updated successfully, but these errors were encountered: