see this for the detail but only in Japanese
This is a modified version of CircuitJs enabled GPIO on Raspberry Pi with WebIOPi.