chore: add command pnpm dev:ac for faster api proxy mode

This commit is contained in:
tzhangchi
2022-12-27 23:39:42 +08:00
committed by DarkSky
parent fd9efca91c
commit 18c4d135bd
3 changed files with 18 additions and 6 deletions
+16 -6
View File
@@ -31,12 +31,22 @@ const nextConfig = {
},
// XXX not test yet
rewrites: async () => {
return [
{
source: '/api/:path*',
destination: 'http://100.77.180.48:11001/api/:path*',
},
];
if (process.env.NODE_API_SERVER === 'ac') {
console.log('use ac server');
return [
{
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,
};