This guide provides the necessary environment variables required to run the Survey App.
Create a .env file inside the Backend directory and add the following:
PORT=3000 # Backend Port
MONGO_URL=your_mongodb_connection_string # MongoDB connection URL
CORS_ORIGIN=http://localhost:5173 # CORS origin (Frontend URL)
JWT_SECRET=your_jwt_secret # JWT Secret key Create a .env file inside the Frontend directory and add the following:
VITE_API_BASE_URL=http://localhost:3000/api # Backend API base URLIf running the backend on port 3000, the environment variable VITE_API_BASE_URL in the frontend .env file should be set to:
VITE_API_BASE_URL=http://localhost:3000/api
- Create
.envfiles in bothBackendandFrontenddirectories. - Fill in the necessary credentials (e.g.,
MONGO_URL,JWT_SECRET). - Restart the servers after setting up the environment variables.
Now you're ready to run your Survey App! 🚀