3

I'm looking for a way to create an app which has a realtime web interface as well as an API which can be called by a node.js client while sharing most of its code.

I'd like to be able to manage data, monitor and execute tasks inside of my app via browser, but also have an automation/scheduling program which connects to my web app and tells it to run various tasks and get results of each task.

Unfortunately it doesn't look like I can connect to Meteor from the server, so I'm wondering if there's another approach? Is what I described even possible using Meteor?

I have done some testing using socket.io and I think I may be able to do it this way, but Meteor seems like it'd be really great for the realtime user interface.

Stephen Corgiat
  • 105
  • 1
  • 7
  • 2
    _"Unfortunately it doesn't look like I can connect to Meteor from the server, so I'm wondering if there's another approach?"_ Please refrase your question as you are not very precise in what you want to have. – Michel Löhr Jun 04 '12 at 10:22
  • So do you mean something like remote functions or publish/subsribe? Or something different? (The first two items are supported by Meteor) – Michel Löhr Jun 04 '12 at 11:33

1 Answers1

3

Yes, you can use npm packages to do what you want. Just like standard Node.js programming.

There might be one error you run into when calling Meteor between external code, but it is easy to solve.

I guess in your case you could set up a TCP server that way and make it update a collection, then you could get the clients to update through the reactive collection publishing mechanism.

Community
  • 1
  • 1
Tamara Wijsman
  • 12,198
  • 8
  • 53
  • 82
  • Thanks, I realized you could use outside packages but your mention of a TCP server to update a collection was helpful. I'm going to develop my "backend" using hook.io, and Meteor will be another hook listening for events to update collections. Hopefully it works out! – Stephen Corgiat Jun 02 '12 at 17:02