I have my own nodejs webserver and want to load my modules from this server. When I enter the following code on the right side of the Web IDE everything works hwever I get error messages like "Unexpected reserved word in http://192.168.88.117:8081/Wireless.js":
Transmit = require("http://192.168.88.117:8081/transmitClass.js");
Wireless = require("http://192.168.88.117:8081/Wireless.js");
Switch = require("http://192.168.88.117:8081/switchClass.js");
oWl = new Wireless('myAp', '192.168.88.117', new Switch());
oWl.init();
when I enter the command on the left side, the file is not found:
Transmit = require("http://192.168.88.117:8081/transmitClass.js")
Uncaught Error: Module http://192.168.88.117:8081/transmitClass.js not found
at line 1 col 65
....117:8081/transmitClass.js")
The same happens, when I require such a module within the module:
doTransmit() {
console.log('Call Transmit');
var url = 'http://'+this.wServer+':8081/transmitClass.js';
Transmit = require(url);
this.oTr = new Transmit(this.wServer, this.mThing);
this.oTr.init();
}
I do not understand this behaviour. Could somebody explain this to me?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I have my own nodejs webserver and want to load my modules from this server. When I enter the following code on the right side of the Web IDE everything works hwever I get error messages like "Unexpected reserved word in http://192.168.88.117:8081/Wireless.js":
when I enter the command on the left side, the file is not found:
The same happens, when I require such a module within the module:
I do not understand this behaviour. Could somebody explain this to me?
Thanks for all,
Thomas