zero
zero copied to clipboard
Node.js: Add debug support
Currently, if you run zero with debug option - it will error in the console, that the desired port is already in use. I assume it launches each sub-node with the same arguments, so it ends up with port duplications. Therefore, what I'd suggest is: On debugging:
- build all endpoints immediately (not on request) - this is to be able to attach debugger before running the code.
- add a unique parameter to be able to see it in the process list (like a path to the endpoint/page)
- add a unique port to node processes, so we could to attach the debugger to any of them
- return ports list in the console