Fix: Start if backend started already

This commit is contained in:
LmeSzinc 2021-10-27 23:13:50 +08:00
parent 87a0afb325
commit 3cd9078fd8

View File

@ -126,8 +126,10 @@ alas.on('stderr', function (message: string) {
* Receive logs, judge if Alas is ready
* For starlette backend, there will have:
* `INFO: Uvicorn running on http://0.0.0.0:22267 (Press CTRL+C to quit)`
* Or backend has started already
* `[Errno 10048] error while attempting to bind on address ('0.0.0.0', 22267): `
*/
if (message.includes('running on')) {
if (message.includes('running on') || message.includes('bind on address')) {
alas.removeAllListeners('stderr');
loadURL()
}