javascript - How can I use RethinkDB with EmberJS framework? -


i'm new emberjs , rethinkdb. i'm using changefeeds of rethinkdb user specific data create web push notification application emberjs.

i have created same nodejs , socket.io. working fine. want convert emberjs code. when tried include rethinkdb in bower.json. im getting message "package rethinkdb not found".

"rethinkdb": "~2.0.0" 

enter image description here

the below working code nodejs socket.io , rethinkdb

server.js

var sockio = require("socket.io"); var app = require("express")(); var r = require("rethinkdb"); var http = require('http');  var io = sockio.listen(app.listen(3000), {log: false});  app.get('/', function (req, res) {     res.sendfile(__dirname + '/home.html'); });    r.connect({host: 'localhost', port: 28015}) .then(function(conn){return r.db('my_db').table('user_feeds').changes().run(conn);}) .then(function(cursor){cursor.each(function(err, data) {              io.emit('feeds', data);       console.log("after data >>>>>\n"+json.stringify(data)); });});  console.log("server started @ http://127.0.0.1:3000/"); 

home.html

<!doctype html> <html> <head> <meta charset="iso-8859-1"> <title>asset tracker</title> <script src="https://cdn.socket.io/socket.io-1.4.5.js"></script> <script type="text/javascript"> window.onload = function() { var socket = io.connect(); socket.on("feeds", function(data) {     document.getelementbyid("feeds").innerhtml = json.stringify(data);  }); }; </script> </head> <body> <div id="feeds"></div> </body> </html> 

i want above code migrated emberjs. i'am new ember find difficult migrate. not of code sample available rethinkdb emberjs online.

since client side code doesn't contain rethinkdb specific code should socket.io ember. there several implementations emberjs.

there no rethinkdb package published in bower. there npm package can use in browser well.


Comments