json-rpc ask from other code
romablog opened this issue · 1 comments
how to create request to rpc.server form code on AngularJS?
Is it possible or i should use only rpc.client for reqests?
this module is focused on node.js side only. it can't be used on the browser.
if angular has any module that can craft RPC requests, then it would work.
just remember to set the CORS correctly, since the RPC server is usually listening on another port or another domain, unless you're using some sort of load balancer like nginx for internal proxy pass.
basically it works like this: you have a nginx listening on port 80. if you try to reach rpc.yourdomain.com, it redirects internally to your node.js server listening on port 8080 (for example) waiting for RPC commands. if it tries to reach yourdomain.com, it would serve your regular website