Thanks, I had looked at the examples and have used it previously, clearly I needed to sleep on it but I think I get it now.
I could type:
192.168.0.13/set?23
function onPageRequest(req, res) {
var a = url.parse(req.url, true);
if (a.pathname=="/set") {
targetRoomTemp= a.query
}
to change the varible 'targetRoomTemp' to 23?
Or with 192.168.0.13/set/23
function onPageRequest(req, res) {
var a = url.parse(req.url, true);
'a.pathname'.split('/')==[1,2,3];
if (a.pathname(2)=="/set") {
targetRoomTemp= a.pathname(3);
}
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.
Thanks, I had looked at the examples and have used it previously, clearly I needed to sleep on it but I think I get it now.
I could type:
192.168.0.13/set?23
to change the varible 'targetRoomTemp' to 23?
Or with 192.168.0.13/set/23