tj/serve

Ugly console output if port is already in use

k7sleeper opened this issue · 2 comments

Running serve twice prints

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1039:14)
    at listen (net.js:1061:10)
    at Server.listen (net.js:1127:5)
    at Function.app.listen (D:\dev\lng\JavaScript\node.js\node-globals\node_modules\serve\node_modules\connect\lib\proto.js:229:24)
    at Object.<anonymous> (D:\dev\lng\JavaScript\node.js\node-globals\node_modules\serve\bin\serve:113:8)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

to the console the second time. Nicer output would be apreciated.

jamen commented

I don't think the output should be overwritten completely. Maybe a more nice looking output by default, then a --stack flag to get the stack trace instead.

amio commented

For handy use, I think we may try another port (e.g. 3001) if the port 3000 was in use.
@stevemao What do you think?