mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 22:18:54 +08:00
chore: add command pnpm dev:ac for faster api proxy mode
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm --filter=!@pathfinder/app build && pnpm --filter @pathfinder/app dev",
|
"dev": "pnpm --filter=!@pathfinder/app build && pnpm --filter @pathfinder/app dev",
|
||||||
|
"dev:ac": "pnpm --filter=!@pathfinder/app build && pnpm --filter @pathfinder/app dev:ac",
|
||||||
"build": " pnpm --filter=!@pathfinder/app build && pnpm --filter!=@pathfinder/data-services -r build",
|
"build": " pnpm --filter=!@pathfinder/app build && pnpm --filter!=@pathfinder/data-services -r build",
|
||||||
"export": "pnpm --filter @pathfinder/app export",
|
"export": "pnpm --filter @pathfinder/app export",
|
||||||
"start": "pnpm --filter @pathfinder/app start",
|
"start": "pnpm --filter @pathfinder/app start",
|
||||||
|
|||||||
@@ -31,12 +31,22 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
// XXX not test yet
|
// XXX not test yet
|
||||||
rewrites: async () => {
|
rewrites: async () => {
|
||||||
return [
|
if (process.env.NODE_API_SERVER === 'ac') {
|
||||||
{
|
console.log('use ac server');
|
||||||
source: '/api/:path*',
|
return [
|
||||||
destination: 'http://100.77.180.48:11001/api/:path*',
|
{
|
||||||
},
|
source: '/api/:path*',
|
||||||
];
|
destination: 'http://100.85.73.88:12001/api/:path*',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
source: '/api/:path*',
|
||||||
|
destination: 'http://100.77.180.48:11001/api/:path*',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
basePath: process.env.BASE_PATH,
|
basePath: process.env.BASE_PATH,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 8080",
|
"dev": "next dev -p 8080",
|
||||||
|
"dev:ac": "NODE_API_SERVER=ac next dev -p 8080",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"export": "next export",
|
"export": "next export",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
|
|||||||
Reference in New Issue
Block a user