feat: close #663 allow disable user api key input

This commit is contained in:
Yidadaa
2023-05-03 23:49:33 +08:00
parent b1ea26467d
commit 074bd9f045
8 changed files with 57 additions and 23 deletions

View File

@@ -4,6 +4,20 @@ const nextConfig = {
experimental: {
appDir: true,
},
async rewrites() {
const ret = [];
const apiUrl = process.env.API_URL;
if (apiUrl) {
console.log("[Next] using api url ", apiUrl);
ret.push({
source: "/api/:path*",
destination: `${apiUrl}/:path*`,
});
}
return ret;
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,