@MichalZalecki
const app = express();
const httpServer = https.createServer(sslOpts, app).listen(PORT);
const horizonServer = horizon(httpServer, hzOpts);
horizonServer._reql_conn._ready_promise.then((reql_conn) => {
const r = horizon.r;
const connection = reql_conn.connection();
r.table("games").changes().run(connection).then(...);
});
horizonServer.add_auth_provider(
horizon.auth.twitter, { id, secret, path }
);
horizonServer.add_auth_provider(
horizon.auth.github, { id, secret, path }
);
function login(provider) {
hz.authEndpoint(provider).subscribe((endpoint) => {
window.location.replace(endpoint);
});
}