-
• #2
It fails on linux too.
It's because
http.createServer
returns an object of classhttpSrv
. If you then overwrite that built-in class with your own function, magically all the built-in methods of httpSrv disappear.It's not a bug, it's just part of JS. Rename
httpSrv
tohttpServer
and it'll be fine :) -
• #3
Sometimes life can be so easy, once you know how to live.
Thanks a lot, a "many-hours-without-success-story" comes to an end ;-)
Attached code runs fine, but after moving everything into an object, by removing comments, fails with this error.
*Uncaught Error: Function "listen" not found!
at line 13 col 10
Got this problem on ESP32, could not test on other board. @Gordon, if this is an ESP32 only problem, please move it to that category :-)
Tested this 10 times with both options and always got same result.