Skip to content

Commit

Permalink
Remove client app env variables for Formio base URL and project name
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneymyers committed Jan 27, 2025
1 parent 8505fac commit b1ac196
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
6 changes: 0 additions & 6 deletions app/client/.env.example

This file was deleted.

24 changes: 1 addition & 23 deletions app/client/src/config.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
const {
MODE,
VITE_SERVER_BASE_PATH,
VITE_CLOUD_SPACE,
VITE_FORMIO_BASE_URL,
VITE_FORMIO_PROJECT_NAME,
} = import.meta.env;

if (!VITE_FORMIO_BASE_URL) {
const message = `Required VITE_FORMIO_BASE_URL environment variable not found.`;
throw new Error(message);
}

if (!VITE_FORMIO_PROJECT_NAME) {
const message = `Required VITE_FORMIO_PROJECT_NAME environment variable not found.`;
throw new Error(message);
}
const { MODE, VITE_SERVER_BASE_PATH, VITE_CLOUD_SPACE } = import.meta.env;

// allows the app to be accessed from a sub directory of a server (e.g. /csb)
export const serverBasePath =
Expand All @@ -25,12 +9,6 @@ export const serverUrl = window.location.origin + serverBasePath;
export const cloudSpace =
MODE === "development" ? "dev" : VITE_CLOUD_SPACE || "";

export const formioBaseUrl = VITE_FORMIO_BASE_URL;

const formioProjectName = VITE_FORMIO_PROJECT_NAME;

export const formioProjectUrl = `${formioBaseUrl}/${formioProjectName}`;

export const messages = {
genericError: "The application has encountered an unknown error.",
authError: "Authentication error. Please log in again or contact support.",
Expand Down

0 comments on commit b1ac196

Please sign in to comment.