mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
fix(server): should not listen on user defined host (#5622)
This commit is contained in:
@@ -4,11 +4,7 @@ const env = process.env;
|
|||||||
const node = AFFiNE.node;
|
const node = AFFiNE.node;
|
||||||
|
|
||||||
// TODO(@forehalo): detail explained
|
// TODO(@forehalo): detail explained
|
||||||
AFFiNE.host = 'localhost';
|
|
||||||
AFFiNE.port = 3010;
|
|
||||||
|
|
||||||
if (node.prod) {
|
if (node.prod) {
|
||||||
AFFiNE.host = '0.0.0.0';
|
|
||||||
// Storage
|
// Storage
|
||||||
if (env.R2_OBJECT_STORAGE_ACCOUNT_ID) {
|
if (env.R2_OBJECT_STORAGE_ACCOUNT_ID) {
|
||||||
AFFiNE.storage.providers.r2 = {
|
AFFiNE.storage.providers.r2 = {
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ import './prelude';
|
|||||||
import { createApp } from './app';
|
import { createApp } from './app';
|
||||||
|
|
||||||
const app = await createApp();
|
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(
|
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}`);
|
console.log(`And the public server should be recognized as ${AFFiNE.baseUrl}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user