In Node.js, how to make one server call a function on another server?

Let's say I have 2 web servers. Both of them have just installed Node.js and are launching a website (using Express). Pretty simple stuff.

How does server-A tell server-B to execute a function? (inside Node.js)

Preferably ... is there an npm module for this, which makes it very easy for me?

+7
source share
2 answers

How does server-A tell server-B to execute a function?

You can use one of the RPC , for example dnode .

+5
source

Most likely you want something like a JSON-RPC module for Node. After some quick searching, here is the JSON-RPC middleware for Connect, which is ideal for use with Express.

In addition, this looks promising.

+2
source

All Articles