fix: remove max upload size from settings / use env var instead to centralize the config

This commit is contained in:
Mohamed Marrouchi
2024-12-27 17:22:35 +01:00
parent bb83cd53bc
commit 99c702de17
17 changed files with 63 additions and 91 deletions

View File

@@ -6,8 +6,13 @@
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/
export const DEFAULT_CONFIG = {
import { Config } from "../types/config.types";
export const DEFAULT_CONFIG: Config = {
apiUrl: process.env.REACT_APP_WIDGET_API_URL || "http://localhost:4000",
channel: process.env.REACT_APP_WIDGET_CHANNEL || "console-channel",
language: "en",
maxUploadSize: process.env.UPLOAD_MAX_SIZE_IN_BYTES
? Number(process.env.UPLOAD_MAX_SIZE_IN_BYTES)
: 20 * 1024 * 1024, // 20 MB in bytes
};