mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-24 05:07:06 +08:00
feat: printer next (#601)
* feat: add printer and next.js logger style * chore: add info for API Proxy * tests: unit test cases is added to printer * fix: deps Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
const { getGitVersion, getCommitHash } = require('./scripts/gitInfo');
|
||||
const { dependencies } = require('./package.json');
|
||||
const path = require('node:path');
|
||||
const printer = require('./scripts/printer').printer;
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
@@ -32,18 +33,24 @@ const nextConfig = {
|
||||
// XXX not test yet
|
||||
rewrites: async () => {
|
||||
if (process.env.NODE_API_SERVER === 'ac') {
|
||||
console.log('use ac server');
|
||||
let destinationAC = 'http://100.85.73.88:12001/api/:path*';
|
||||
printer.info('API request proxy to [AC Server] ' + destinationAC);
|
||||
return [
|
||||
{
|
||||
source: '/api/:path*',
|
||||
destination: 'http://100.85.73.88:12001/api/:path*',
|
||||
destination: destinationAC,
|
||||
},
|
||||
];
|
||||
} else {
|
||||
let destinationStandard = 'http://100.77.180.48:11001/api/:path*';
|
||||
printer.info(
|
||||
'API request proxy to [Standard Server] ' + destinationStandard
|
||||
);
|
||||
|
||||
return [
|
||||
{
|
||||
source: '/api/:path*',
|
||||
destination: 'http://100.77.180.48:11001/api/:path*',
|
||||
destination: destinationStandard,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user