Is any possibility to pass data from main.js to application/index.php ? I have a little project that requires arduino and I use serialport in main.js to take data from arduino and with socket.io I want to emit that data to application/index.php .
This is my socket.io test function in main.js
var io = require('socket.io').listen(server);
function sendTime() {
io.emit('time', { time: new Date().toJSON() });
}
setInterval(sendTime, 100);
You are going to have to look into a standard AJAX solution more than likely. Your NW.js app is the client running a server. So you basically need to have that client pass data to the server.
Is any possibility to pass data from main.js to application/index.php ? I have a little project that requires arduino and I use serialport in main.js to take data from arduino and with socket.io I want to emit that data to application/index.php .
This is my socket.io test function in main.js
This is my function from index.php: