Reputation: 12837
After the recent Railscast on Meteor, my interest was piqued, particularly as I'm looking to implement a live events feed for my Rails app.
It seems to me that Meteor is the perfect solution for my requirements but I'm kinda stuck at the first hurdle.
My requirement is to be able to post data to a Meteor server from my main site (Rails app) and embed the resulting meteor client web page into my main app.
so how would I go about sending the data to the Meteor server and have the Meteor client automatically pick up the data?
Any ideas as to the best approach for this appreciated. I guess I'm looking for a Meteor api that will accept data from an external data source
UPDATE Perhaps I need to write a DDP client to work with Rails?
Upvotes: 4
Views: 1147
Reputation: 3682
A Meteor application's underlying a data collections are Mongodb collections. So, from that perspective you could.
Write a DDP Client for Rails.
Insert directly into the MongoDB from Rails. If your Meteor app is subscribed on the client side the data will be published automagically in the browser view. This can be shown by subscribing to data on the client and inserting from the browser console, the os console (via mongo directly or meteor mongo on cmd prompt and using db.collection.insert). You can connect to your own Mongo server, you don't have to use the Mongo inside of a Meteor app.
CRUD for Meteor collections will allow you to expose a RESTy type of interface. Albeit Meteor frees you from this old paradigm.
https://github.com/crazytoad/meteor-collectionapi
Start porting your app over to Meteor section by section including the data collection, processing and inserts. You could use iFrames, etc... there is a thread on Google meteor-talk about this.
I hope that gave you some options. I would probably do #2 and start moving toward #4.
S
Upvotes: 5