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