How to use Rails as a DDP server with Meteor.js client

We have a Rails application that works only with the HTTP API. Currently, client side uses Ember.js. We are not too impressed with Ember and are very similar to the Meteor.js approach. Therefore, we want to exchange the client side with Meteor.js and contact the Rails server through the web ports that talk about the Data Distribution Protocol (DDP), so we can continue to use models, mailers, and controllers in Rails. Implementation of the server side of the DDP should be easy.

However, we are not sure how to create Rails sites. We found that Reel, which seems to make it easier to receive websocket requests in a standalone environment. The coil seems great, as we would like to implement DDP on top of Celluloid racks. But what about running Reel in a Rails environment? For this we need a "runner for rails"? And we would like to continue to use existing controllers to send incoming requests (for example, to add / change / delete resources). Is this possible even without a request coming through the rack?

Any input is appreciated.

+4
source share
2 answers

A bit late, but I implemented DDP in Ruby, you can check it here:

https://github.com/d-snp/ruby-ddp-server

EJSON. -websocket .

RethinkDB, .

https://github.com/d-snp/ruby-ddp-server-rethinkdb

, :

https://github.com/d-snp/celluloid-rethinkdb-chat

+4

, , "" Rails-. , :

- Rails-//, , Rails JSON-apis , Meteor http-, MongoDB , , .

, Mongo mySql ( Rails) , Rails, JS, Meteor , .

+2

Source: https://habr.com/ru/post/1536307/


All Articles