donejs / done-serve

DoneJS development server
https://www.npmjs.com/package/done-serve
MIT License
7 stars 5 forks source link

Server crashes when restarting proxied API server #24

Open phillipskevin opened 7 years ago

phillipskevin commented 7 years ago

When using --proxy for an API server, done-serve crashes when the API server is restarted:

done-serve --develop --port 8080 --proxy http://localhost:3030

...

/path/to/app/node_modules/http-proxy/lib/http-proxy/index.js:119
    throw err;
    ^

Error: connect ECONNREFUSED 127.0.0.1:3030
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)

It's very annoying to have to restart done-serve every time the API server is restarted. We should try to handle this if possible.

phillipskevin commented 7 years ago

This is with done-serve@1.0.0-alpha.0.

phillipskevin commented 7 years ago

Also, the live-reload server doesn't crash, so restarting done-serve cannot restart live-reload:

done-serve --develop --port 8080 --proxy http://localhost:3030

done-serve starting on http://localhost:8080
Can not start live-reload on port 8012.
Another application is already using it.
Mrfuture1 commented 7 years ago

Is the problem solved?