feat: dynamic config

This commit is contained in:
Yidadaa
2023-04-11 02:54:31 +08:00
parent 9b61cb1335
commit d6e6dd09f0
8 changed files with 160 additions and 154 deletions

View File

@@ -32,7 +32,7 @@ export function middleware(req: NextRequest) {
// inject api key
if (!token) {
const apiKey = process.env.OPENAI_API_KEY;
const apiKey = serverConfig.apiKey;
if (apiKey) {
console.log("[Auth] set system token");
req.headers.set("token", apiKey);