Directorio UDC uses environment variables to control runtime behaviour — including the port the Express server binds to and the API base URL that the React frontend uses when making requests. Both theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Minogar28/DIRECTORIO_UDC/llms.txt
Use this file to discover all available pages before exploring further.
BACKEND and FRONTEND packages read from their own .env file, which you create locally and never commit to version control.
Backend Environment Variables
The Express backend reads environment variables directly fromprocess.env at startup. The following variable is recognised:
| Variable | Description | Default |
|---|---|---|
PORT | The port the Express server listens on | 3000 |
PORT inline when starting the server:
.env file in the BACKEND directory. The BACKEND/.gitignore already excludes both node_modules and .env, so this file will never be accidentally committed:
dotenv package) to the backend, the .env file is picked up automatically at startup. Without a loader, set variables in your shell or in your deployment platform’s environment settings.
Frontend Environment Variables
Vite exposes environment variables to the client bundle throughimport.meta.env. Only variables whose names are prefixed with VITE_ are injected into the browser bundle — all others remain server-side.
| Variable | Description | Example value |
|---|---|---|
VITE_API_URL | The base URL of the Express backend API | http://localhost:3000 |
.env file in the FRONTEND directory:
Vite Modes
Vite has a built-in concept of modes that controls which.env file is loaded and how the bundle is optimised:
developmentmode is active when you runnpm run dev.import.meta.env.DEVistrueand source maps are enabled.productionmode is active when you runnpm run build.import.meta.env.PRODistrue, the bundle is minified, and dead-code elimination runs at full strength.
.env.[mode] files (e.g. .env.staging) and passing --mode staging to the Vite CLI.
The standard Vite built-in environment variables always available in your code are:
| Variable | Value |
|---|---|
import.meta.env.MODE | "development" or "production" |
import.meta.env.DEV | true in dev mode |
import.meta.env.PROD | true in production build |
import.meta.env.BASE_URL | The base URL of the deployed app |
Restart the Vite dev server after changing any
.env file — Vite reads environment variables once at startup and does not hot-reload them. Simply stop the process with Ctrl+C and run npm run dev again.