I wonder if someone can give me an example about how "node-remote" works if I want to run some of the logic/functions of my application from the server.
Like, I don't know what to do after adding "node-remote" : "hostip" into package.json, what should my server provide? .js file that has the functions I want to run? So is it like: "node-remote" : "myappserver.com/funcs.js" ? I am so confused about this...
I can't find enough information on web about this, so some help or at least a better explanation of "baconface"'s reply from this link would be so helpful: https://github.com/nwjs/nw.js/issues/3278
node-remote is used for to expose node.js + nw.gui APIs for html script tags and javascript files coming from your website. That's it! You can use require, objects like global, process in these files.
node-remote parameter itself expects a domain name or ip address of hosts you want nw.js to allow to use node.js APIs for these hosts while other hosts can't access them.
Little example:
package.json and set node-remote parameter to github.com on it.package.json.nw application.https://github.com/ on it.Developer Tools.require('fs').readFileSync('test.txt', 'Hello, World!') and hit enter.Now you should see test.txt file in nw's root directory.
test.txt.package.json and remove node-remote field.Now you should see error like "require" is undefined in DevTools console
Hope this helps.