mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 18:41:52 +08:00
fix: API server address in electron (#1888)
Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
@@ -42,7 +42,7 @@ env:
|
|||||||
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}
|
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}
|
||||||
AFFINE_GOOGLE_CLIENT_ID: ${{ secrets.AFFINE_GOOGLE_CLIENT_ID }}
|
AFFINE_GOOGLE_CLIENT_ID: ${{ secrets.AFFINE_GOOGLE_CLIENT_ID }}
|
||||||
AFFINE_GOOGLE_CLIENT_SECRET: ${{ secrets.AFFINE_GOOGLE_CLIENT_SECRET }}
|
AFFINE_GOOGLE_CLIENT_SECRET: ${{ secrets.AFFINE_GOOGLE_CLIENT_SECRET }}
|
||||||
NODE_API_SERVER: 'https://app.affine.pro'
|
API_SERVER_PROFILE: prod
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
make-macos:
|
make-macos:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
|
|||||||
# absolute path to the block suite directory
|
# absolute path to the block suite directory
|
||||||
LOCAL_BLOCK_SUITE=
|
LOCAL_BLOCK_SUITE=
|
||||||
# see next.config.js
|
# see next.config.js
|
||||||
NODE_API_SERVER=
|
API_SERVER_PROFILE=
|
||||||
# save workspace to idb
|
# save workspace to idb
|
||||||
ENABLE_IDB_PROVIDER=1
|
ENABLE_IDB_PROVIDER=1
|
||||||
PREFETCH_WORKSPACE=1
|
PREFETCH_WORKSPACE=1
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const profileTarget = {
|
|||||||
dev: '100.84.105.99:11001',
|
dev: '100.84.105.99:11001',
|
||||||
test: '100.84.105.99:11001',
|
test: '100.84.105.99:11001',
|
||||||
stage: '',
|
stage: '',
|
||||||
pro: 'http://pathfinder.affine.pro',
|
prod: 'http://app.affine.pro',
|
||||||
local: '127.0.0.1:3000',
|
local: '127.0.0.1:3000',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -89,7 +89,8 @@ const nextConfig = {
|
|||||||
gitVersion: getGitVersion(),
|
gitVersion: getGitVersion(),
|
||||||
hash: getCommitHash(),
|
hash: getCommitHash(),
|
||||||
serverAPI:
|
serverAPI:
|
||||||
profileTarget[process.env.NODE_API_SERVER || 'dev'] ?? profileTarget.dev,
|
profileTarget[process.env.API_SERVER_PROFILE || 'dev'] ??
|
||||||
|
profileTarget.dev,
|
||||||
editorVersion: require('./package.json').dependencies['@blocksuite/editor'],
|
editorVersion: require('./package.json').dependencies['@blocksuite/editor'],
|
||||||
...preset,
|
...preset,
|
||||||
},
|
},
|
||||||
@@ -117,7 +118,7 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
rewrites: async () => {
|
rewrites: async () => {
|
||||||
const [profile, target, desc] = getRedirectConfig(
|
const [profile, target, desc] = getRedirectConfig(
|
||||||
process.env.NODE_API_SERVER
|
process.env.API_SERVER_PROFILE
|
||||||
);
|
);
|
||||||
console.info(`API request proxy to [${desc} Server]: ` + target);
|
console.info(`API request proxy to [${desc} Server]: ` + target);
|
||||||
return profile;
|
return profile;
|
||||||
|
|||||||
+2
-2
@@ -11,8 +11,8 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "dev-web",
|
"dev": "dev-web",
|
||||||
"dev:ac": "NODE_API_SERVER=ac yarn workspace @affine/web dev",
|
"dev:ac": "API_SERVER_PROFILE=ac yarn workspace @affine/web dev",
|
||||||
"dev:local": "NODE_API_SERVER=local yarn workspace @affine/web dev",
|
"dev:local": "API_SERVER_PROFILE=local yarn workspace @affine/web dev",
|
||||||
"dev:app": "yarn workspace @affine/electron dev:app",
|
"dev:app": "yarn workspace @affine/electron dev:app",
|
||||||
"build": "yarn workspace @affine/web build",
|
"build": "yarn workspace @affine/web build",
|
||||||
"build:client": "yarn workspace @affine/client-app build:app",
|
"build:client": "yarn workspace @affine/client-app build:app",
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const dev = await p.group(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const env = {
|
const env = {
|
||||||
NODE_API_SERVER: dev.server,
|
API_SERVER_PROFILE: dev.server,
|
||||||
PATH: process.env.PATH,
|
PATH: process.env.PATH,
|
||||||
NODE_ENV: 'development',
|
NODE_ENV: 'development',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ const config: PlaywrightTestConfig = {
|
|||||||
ENABLE_DEBUG_PAGE: '1',
|
ENABLE_DEBUG_PAGE: '1',
|
||||||
ENABLE_SUBPAGE: '1',
|
ENABLE_SUBPAGE: '1',
|
||||||
ENABLE_CHANGELOG: '1',
|
ENABLE_CHANGELOG: '1',
|
||||||
NODE_API_SERVER: 'local',
|
API_SERVER_PROFILE: 'local',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user