fix(server): should not listen on user defined host (#5622)

This commit is contained in:
liuyi
2024-01-18 04:59:52 +00:00
parent 74a3a795bd
commit 9fdbb3ac3d
2 changed files with 3 additions and 6 deletions
+3 -2
View File
@@ -5,9 +5,10 @@ import './prelude';
import { createApp } from './app';
const app = await createApp();
await app.listen(AFFiNE.port, AFFiNE.host);
const listeningHost = AFFiNE.deploy ? '0.0.0.0' : 'localhost';
await app.listen(AFFiNE.port, listeningHost);
console.log(
`AFFiNE Server has been started on http://${AFFiNE.host}:${AFFiNE.port}.`
`AFFiNE Server has been started on http://${listeningHost}:${AFFiNE.port}.`
);
console.log(`And the public server should be recognized as ${AFFiNE.baseUrl}`);