Final Project for 118W (Apollo Dash)
Follow these steps to get the project up and running:
npm install express mongoose dotenv corsNavigate to the /server directory and create a .env file:
cd main/server
touch .envInside .env, add your MongoDB connection URI and desired port:
MONGO_URI=your_mongo_uri
PORT=5000Replace your_mongo_uri with your actual MongoDB Atlas connection string. You can use any available port, such as 5000.
To start the Node.js server:
node server.jsYou have two options to run your frontend:
Install the Live Server extension (if using VSCode), then right-click your main index.html file and select "Open with Live Server". This will launch the frontend on a browser with live reload support.
If you're serving the frontend from Express, make sure to add static file serving in index.js:
app.use(express.static('public'));