Estimated Time: 2 hours
Status: ☐ Not Started
.env
files[ ] Install CORS middleware:
npm install cors
[ ] Use it in Express:
const cors = require("cors");app.use(cors({ origin: "<http://localhost:3000>", credentials: true }));
[ ] Set up environment variables with dotenv:
npm install dotenv
[ ] Add to your server entry:
require("dotenv").config();
[ ] Create a .env
file and add your secrets:
MONGO_URI=yourMongoDBConnectionString
JWT_SECRET=yourJWTSecret
[ ] Use process.env.VARIABLE
in code