It's because http.createServer returns an object of class httpSrv. 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 to httpServer and it'll be fine :)
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.
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 :)