diff --git a/backend/utils/vectordatabases/providers/chroma/index.js b/backend/utils/vectordatabases/providers/chroma/index.js index 11f2ad2b..f3ec4a87 100644 --- a/backend/utils/vectordatabases/providers/chroma/index.js +++ b/backend/utils/vectordatabases/providers/chroma/index.js @@ -14,30 +14,36 @@ class Chroma { // For use with ChromaClient SDK only. #appendClientAuthHeaders() { - const { settings } = this.config + const { settings } = this.config; if (!settings?.authToken) return {}; const headerName = settings.authTokenHeader || "X-Api-Key"; - const authToken = headerName === 'Authorization' ? `Bearer ${settings.authToken}` : settings.authToken + const authToken = + headerName === "Authorization" + ? `Bearer ${settings.authToken}` + : settings.authToken; return { fetchOptions: { headers: { [headerName]: authToken, }, }, - } + }; } // For use with fetch API endpoints only. #appendRawAuthHeaders() { - const { settings } = this.config + const { settings } = this.config; if (!settings?.authToken) return {}; const headerName = settings.authTokenHeader || "X-Api-Key"; - const authToken = headerName === 'Authorization' ? `Bearer ${settings.authToken}` : settings.authToken + const authToken = + headerName === "Authorization" + ? `Bearer ${settings.authToken}` + : settings.authToken; return { [headerName]: authToken, - } + }; } setConfig(config) { diff --git a/devSetup.js b/devSetup.js index 7f8232e1..9acbe2f9 100644 --- a/devSetup.js +++ b/devSetup.js @@ -2,15 +2,20 @@ const fs = require('fs'); const path = require('path'); const serverEnvTemplate = path.resolve(__dirname, 'backend/.env.example'); -const serverEnv = path.resolve(__dirname, 'backend/.env.development') +const serverDevEnv = path.resolve(__dirname, 'backend/.env.development') +const serverEnv = path.resolve(__dirname, 'backend/.env') + const frontendEnvTemplate = path.resolve(__dirname, 'frontend/.env.example'); const frontendEnv = path.resolve(__dirname, 'frontend/.env') const workerEnvTemplate = path.resolve(__dirname, 'workers/.env.example'); const workerEnv = path.resolve(__dirname, 'workers/.env') -if (!fs.existsSync(serverEnv)) { - console.log("Copying server env file template."); +if (!fs.existsSync(serverEnv) || !fs.existsSync(serverDevEnv)) { + console.log("Copying server env & env.development file template."); + fs.writeFileSync(serverDevEnv, ''); fs.writeFileSync(serverEnv, ''); + + fs.copyFileSync(serverEnvTemplate, serverDevEnv); fs.copyFileSync(serverEnvTemplate, serverEnv); console.log("Server env file created."); } diff --git a/frontend/src/utils/constants.ts b/frontend/src/utils/constants.ts index e603ac54..b48771d5 100644 --- a/frontend/src/utils/constants.ts +++ b/frontend/src/utils/constants.ts @@ -1,4 +1,4 @@ -export const API_BASE = import.meta.env.VITE_API_BASE || "/api"; +export const API_BASE = import.meta.env.VITE_API_BASE || '/api'; export const APP_NAME = import.meta.env.VITE_APP_NAME || 'VDMS'; export const STORE_USER = 'vdms_user'; export const STORE_TOKEN = 'vdms_authToken';